Question: ( 3 ) Square If the user input 1 , ask the user to input the width and length of the rectangle, and then print

(3) Square
If the user input 1, ask the user to input the width and length of the
rectangle, and then print the shape name (Rectangle) and the area.
If the user input 2, ask the user to input the radius of the circle. Then print
the shape name (Circle) and the area.
If the user input 3, ask the user to input the side length, and then print the
shape name (Square) and the area.
Page 15 of 60
AUT COMP603/ENSE600 PDC/SC Tutorials
If the user input other numbers, print out "Wrong input" and terminate the
program
If the user input other characters, print out "Invalid input. Not an integer"
and terminate the program.
Find codes from Google/Bing
You may be aware that the output of ShapeCalculator1 is as follows:
You want to format the decimal number, always keeping three decimal places.
Search Google or Bing to find out how to achieve this, making the output like the
follows:
Circle
19.635
Rectangle
198.000
Square
10.890
 (3) Square If the user input 1, ask the user to

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!