Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, you will write a complete program in Python that computes the volume for a number of different shapes. Your program will consist

image text in transcribedimage text in transcribed

In this assignment, you will write a complete program in Python that computes the volume for a number of different shapes. Your program will consist of two files: one is a module, volume.py, which computes volumes and the other is a main program, main.py, which uses the functions in module volume.py. The program is expected to prompt the user for a type of object (e.g. a "cube") and validate that is one of the excepted inputs before computing the volume. In addition, your program should keep track of each volume that is calculated and at the end display the volume for all the shapes. Your program should make use of functions, loops, and lists. Functional Specifications: Your main module, main.py, should handle the prompting and input for the different shapes and the output. Specifically, it should: 1. Prompt the user for the shape they are interested in, check to make sure that their input is valid. Valid input options are: "Cube" or"", "pyramid" or "p", "ellipsoid" or "e" "quit" or "q'; you should accept the input in any combination of upper and lower case letters. If the user enters an invalid option, your program should continue to prompt the user for a correct choice. o Your program should continue to prompt the user for different shapes until the user enters "quit" or "q'. o Once your program has a valid input, it should then use the correct function in volumes.py to prompt the user for the specific values for that shape and compute the volume (see below) o It should then add the resulting volume to a list of volumes for the same kinds of shapes (i.e., all cube volumes will be in the same list). o Once the user has entered "quit" (or "q"), your program should print the list of volumes for each shape, in sorted order, from lowest to highest. o

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

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

3. What are potential solutions?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago