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
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
Get step-by-step solutions from verified subject matter experts
