Question: using python Exerciset 3. Write a program that displays the following menu 1. Rectangle 2. Circle The program, then, reads the menu choice and behaves

 using python Exerciset 3. Write a program that displays the following
using python

Exerciset 3. 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 Program behavior 1 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 2 The program prompts for and reads the radius r of a circle. It then computes and displays the circle. Area = nr I 3.14159 math.pi Input other than 1, and 2 The program displays the following error message: Error: Wrong menu choice and then terminates. 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 cm2 1: Rectangle 2: Circle Enter your choice: 2 Enter radius: 24.89 Circle area= 1946.25 cm2

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!