Question
Write Python Program: Topics: Input, Print, Looping, Functions, Docstring, Import Problem Statement: Solid geometry calculator In this assignment, you will be designing a solid geometric
Write Python Program:
Topics: Input, Print, Looping, Functions, Docstring, Import
Problem Statement: Solid geometry calculator
In this assignment, you will be designing a solid geometric calculator for different shapes. The shapes you need to consider are: cylinder, cube and sphere. Details are below:
Lab Procedure:
Step 1: You need to define the maximum number of user defined functions for each of the following shapes.
Cylinder Formulas (r = radius and h = height):
Calculate volume of a cylinder: V = ?r 2 h
Calculate the lateral surface area of a cylinder: L = 2?rh
Calculate the top and bottom surface area of a cylinder: T = B = ?r 2
Total surface area of a closed cylinder is: A = L + T + B = 2?rh + 2(?r 2 ) = 2?r(h+r)
Formulas for a cube (a = side length):
Volume of a cube: V = a3
Surface area of a cube: S = 6a2
Face diagonal of a cube: f = a?2
Sphere Formulas ( r= radius):
Volume of a sphere: V = (4/3)?r 3
Circumference of a sphere: C = 2?r
Surface area of a sphere: A = 4?r 2
Step 2: Create a utility module to define all your user-defined functions for shape calculations. Create a main application module that allows a user to perform the required calculations according to the choice. The application should provide a menu, should use appropriate screenclearings to assist the user in focusing on the output, and should make maximal use of userdefined functions. The naming convention of the utility and application module will be as follows:
Utility module: firstname_lastname_BWA4_utility.py
Main module: firstname_lastname_BWA4_application.py
Step 3: All the functions should be well documented with docstring and appropriate naming conventions. The docstring should contain the following information:
o Function description
o Parameter/Input: datatype
o Return/output: datatype
Step 4: Your program should handle user-input exceptions for example if user enters something other than number, your program should properly respond to this kind of situation and provide feedback to the user.
Step 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