Question: PYTHON CODE ONLY: Write a program that calculates the areas and volumes of some common geometric shapes. The program should prompt the user to choose
PYTHON CODE ONLY: Write a program that calculates the areas and volumes of some common geometric shapes. The program should prompt the user to choose one of the following six shapes: rectangle, ellipse, triangle, regular octahedron, Spheroid, or regular tetrahedron.
Write a program that calculates the areas and volumes of some common geometric shapes. The program should prompt the user to choose one of the following six shapes: rectangle, ellipse, triangle, regular octahedron, Spheroid, or regular tetrahedron. The program should then calculate the volume and/or area of the selected shape and display the result. Your program should take into account the possibility of incorrect entries from the user. The program should continue to prompt user until exited. The program input/output should be very similar to the following example runs. Enter the number corresponding to the shape whose volume and/or surface area you wish to calculate. Your choices are: 1 - Rectangle, 2 - Ellipse, 3 - Triangle, 4 - Regular Octahedron, 5 - Spheroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 1 Enter side one of the rectangle: 2 Enter side two of the rectangle: 3 The area of the rectangle is: 6.0 Enter the number corresponding to the shape whose volume and/or surface area you wish to calculate. Your choices are: 1 - Rectangle, 2 - Ellipse, 3 - Triangle, 4 - Regular Octahedron, 5 - Spheroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 2 Enter semi-minor axis of the ellipse: 2 Enter semi-major axis of the ellipse: 3 The area of the ellipse is: 18.84955592153876 Enter the number corresponding to the shape whose volume and/or surface area you wish to calculate. Your choices are: 1 - Rectangle, 2 - Ellipse, 3 - Triangle, 4 - Regular Octahedron, 5 - Spheroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 3 Enter side I the triangle: 3 Enter side 2 the triangle: 4 Enter side 3 the triangle: 5 The area of the trianlge is: 6.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
