Question: In python Exercise# 3: Marks: 4 Write a program that displays the following menu: 1: Rectangle 2: Circle The program, then, reads the menu choice

In pythonIn python Exercise# 3: Marks: 4 Write a program that displays the

Exercise# 3: Marks: 4 Write a program that displays the following menu: 1: Rectangle 2: Circle The program, then, reads the menu choice and behaves according to the following table: Menu choice 1 2 Program behavior The program prompts for and reads the width and length of a rectangle. It then computes and displays the area the rectangle. Area=width*length The program prompts for and reads the radius r of a circle. It then computes and displays the circle. Area = nr 2 = 3.14159 math.pi The program displays the following error message : Error: Wrong menu choice and then terminates. Input other than 1, and 2 Note: Assume that the values read by the program for options 1, and 2 are in centimeters. For these options, your program must display appropriate units in the output as shown below. 1: Rectangle 2: Circle Enter your choice: 3 Wrong choice 1: Rectangle 2: Circle Enter your choice: 1 Enter width: 25.32 Enter length: 35.68 Rectangle area= 903.42 cm^2 1: Rectangle 2: Circle Enter your choice: 2 Enter radius: 24.89 Circle area= 1946.25 cm^2

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!