Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Computers are the ultimate calculators. As a warm up, lets compute the surface area and volume for a right circular cone. Program specifications Write a

Computers are the ultimate calculators. As a warm up, lets compute the surface area and volume for a right circular cone. Program specifications Write a Python program called conegeometry.py. You may use the math and sys modules but nothing else. It should accept as arguments form the command line the following parameters in the following order: height, radius, and area_or_volume. If one or more parameters is missing, the program should return usage information and exit. $ python conegeometry . py Usage : $ python conegeomtry . py < height > < radius > < area_or_volume > Similarly, the argument must either be area or volume. Your code must enforce this and return this message if neither area nor volume are passed as arguments. $ python conegeometry . py 10 4 length Usage : $ python conegeomtry . py < height > < radius > < area_or_volume > area_or_volume : must be area or volume In the example (when these are graded I will use different number than what are shown here) where the radius is 4 and the height is 10, the program run will return the surface area as $ python conegeometry . py 10 4 area The surface area of a cone of radius 4.000000 and height 10.000000 is 185.609436 and the volume as $ python conegeometry . py 10 4 volume The volume of a cone of radius 4.000000 and height 10.000000 is 167.551608

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions