Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

image text in transcribed

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 Terminated

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago

Question

10. Are you a. a leader? b. a follower? _______

Answered: 1 week ago