Question: ( 3 ) Square If the user input 1 , ask the user to input the width and length of the rectangle, and then print
Square
If the user input 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 ask the user to input the radius of the circle. Then print
the shape name Circle and the area.
If the user input ask the user to input the side length, and then print the
shape name Square and the area.
Page of
AUT COMPENSE PDCSC 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 GoogleBing
You may be aware that the output of ShapeCalculator 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
Rectangle
Square
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
