Math Problem Statement
Ask the user for the width of a rectangle and a height of a rectangle. These numbers should be doubles. Ask the user to input a width with this prompt:
What is the width of the rectangle?
Then, ask the user to input a height with this prompt:
What is the height of the rectangle?
Finally, your program should print out the area of the rectangle in this form:
The area of the rectangle is __ units squared.
Where the underscores are your rectangle’s area.
The area of a rectangle can be calculated by multiplying the width by the height.
For example, if your program was given the 10.0 for the width and 3.0 for the height, the output would looks as follows:
What is the width of the rectangle? 10.0
What is the height of the rectangle? 3.0
The area of the rectangle is 30.0 units squared.
Solution
Ask a new question for Free
By Image
Drop file here or Click Here to upload
Math Problem Analysis
Mathematical Concepts
Geometry
Area of a Rectangle
Formulas
Area of a rectangle = width * height
Theorems
-
Suitable Grade Level
Grades 5-6