Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
using python
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started