Question: Write a Java program titled FlexibleGeometryCalculator that enhances the GeometryCalculator. java in Lab 1 to make it work for any width & height input since

Write a Java program titled FlexibleGeometryCalculator that enhances the GeometryCalculator. java in Lab 1 to make it work for any width & height input since we learned about variables & capturing user input.
Formulas:
area = width * height
perimeter =2(width + height)
Your program should do the following :
start
declare and initialize integer variables - height, width, area, & perimeter
create scanner object to read input from console
prompt user to Enter width
get width input in inches from the user
prompt user to Enter width
get height input in inches from the user
calculate area
output area
calculate perimeter
output perimeter
end
Example runs are shown below: Note: User input is in bold after each prompt
Enter width: 2
Enter height: 4
Area is 8 square inches.
Perimeter is 12 inches.
Enter width: 5
Enter height: 5
Area is 25 square inches.
Perimeter is 20 inches.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!