Question: python 2. Write a program, with comments, to calculate different parameters of geometric shapes: (31+2=33 points) Ask the user to what type of shape they

python python 2. Write a program, with comments, to calculate different parameters of

2. Write a program, with comments, to calculate different parameters of geometric shapes: (31+2=33 points) Ask the user to what type of shape they want to specify, circle or square. The user should enter 'c' for circle and 's' for square. a) If the user enters 'e': i. ask the user to enter the radius (r) of the circle. Assume the user will enter a valid numeric value. ii. Calculate the area = 3.14*r and display the area rounded to 1 decimal place, with a suitable message. iii. Calculate the circumference = 2*3.14*r and display the circumference rounded to nearest integer, with a suitable message. b) Otherwise, if the user enters 's': i. ask the user to enter the length (s) of one side of the square. Assume the user will enter a valid numeric value. ii. Calculate the area =s and display the area rounded to 1 decimal place, with a suitable message. iii. Calculate the perimeter =4*s and display the perimeter rounded to nearest integer, with a suitable message. c) Otherwise, print the string "You did not enter a valid choice for shape

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!