Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PYTHON CODE ONLY: DONT USE OTHER CHEGG ANSWERS Write a program that calculates the areas and volumes of some common geometric shapes. The program should
PYTHON CODE ONLY: DONT USE OTHER CHEGG ANSWERS
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 Enter the number of your choice: 4 Enter side of the octahedron: 2 The area of the octahedron is: 13.856406460551018 The volume of the octahedron is: 3.771236166328254 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: 5 Enter semi-axis of the spheroid: 2 Enter symmetry semi-axis of the spheroid: 3 The area of the spheroid is: 67.67287265383989 The volume of the spheroid is: 50.26548245743669 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 - Sphroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 6 Enter side of the tetrahedron: 2 The area of the tetrahedron is: 6.928203230275509 The volume of the tetrahedron is: 0.9428090415820635 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 - Sphroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 3333 Incorrect Entry . 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 - Sphroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 6 Enter side of the tetrahedron: 2 The area of the tetrahedron is: 6.928203230275509 The volume of the tetrahedron is 0.9428090415820635 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 - Sphroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 3333 Incorrect Entry 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 - Sphroid, 6 - Regular Tetrahedron. 7 - to exit. Enter the number of your choice: asdfsa Incorrect Entry 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 - Sphroid, 6 - Regular Tetrahedron, 7 - to exit. Enter the number of your choice: 7 Program TerminatedStep 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