Question: 2) Write an interactive program that asks the user to enter the first letter of a geometric shape, and then let your program calculate and

 2) Write an interactive program that asks the user to enter

2) Write an interactive program that asks the user to enter the first letter of a geometric shape, and then let your program calculate and output the area and perimeter of the chosen shape. For simplicity, let your program deal only with rectangles and circles. Hints: For a rectangle: area = base height, perimeter = 2 * (base + height)) For a circle: area-2, circumference-2r, where r is the radius. Your program must display an error message to indicate that the user entered a character other than R', 'r', 'C' or 'c' Use the switch statement to decide which formulas to be used

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!