Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedPYTHON 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

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_2

Step: 3

blur-text-image_3

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

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

1583474013, 978-1583474013

More Books

Students also viewed these Databases questions

Question

4. What advice would you give to Carol Sullivan-Diaz?

Answered: 1 week ago