008-004-005
Multiple Arguments: Rectangle Area
Medium
Problem Description
Multiple Arguments: Rectangle Area
In this problem, you will implement a calculateArea method that takes width and height as arguments and returns the rectangle area (width × height) as an int.
Learning Objective: Learn to define methods with multiple arguments and return values
Specifications
- Complete the
calculateArea(int width, int height)method - Return the product of width and height as an
int
Method Signature
static int calculateArea(int width, int height)
Input / Output
- Input: Read integer
widthand integerheight, one per line - Output: Print the rectangle area (width × height) on one line
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up