Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.0Step 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