0% found this document useful (0 votes)
133 views3 pages

This Assignment Has Three Parts. Part One: Write An Interactive Program To Calculate The Volume and Surface Area of A Three-Dimensional

This assignment had three parts: 1) Write pseudocode for a program to calculate the volume and surface area of a 3D object given user input dimensions. 2) Code the program in Python following conventions for formatting, comments, and variable names. 3) Complete a post mortem review answering questions about the program's purpose, real-world uses, problems encountered, and improvements.

Uploaded by

Bob Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views3 pages

This Assignment Has Three Parts. Part One: Write An Interactive Program To Calculate The Volume and Surface Area of A Three-Dimensional

This assignment had three parts: 1) Write pseudocode for a program to calculate the volume and surface area of a 3D object given user input dimensions. 2) Code the program in Python following conventions for formatting, comments, and variable names. 3) Complete a post mortem review answering questions about the program's purpose, real-world uses, problems encountered, and improvements.

Uploaded by

Bob Smith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Daniel Romanov 02.

03 The Math Module

This assignment has three parts.

Part One: Write an interactive program to calculate the volume and surface area of a three-dimensional
object. Use the following guidelines to write your program:

1. Create a word problem that involves calculating the volume and surface area of a three-
dimensional object. Choose one of the following:
 Cube: surface area 6 s2, volume s3
 Sphere: surface area 4πr², volume (4.0/3.0) π r3
 Cylinder: surface area 2π r2 + 2 π rh, volume π r2 h
 Cone: surface area πr(r + √ r 2 +h2), volume 1.0/3.0 π r2 h
2. Print the description of the word problem for the user to read. 
3. Ask the user to enter the information necessary to perform the calculations. For instance, the
value for the radius.
4. Use 3.14 for the value of π as needed.
5. Print the results of each calculation.
6. Write the pseudocode for this program. Be sure to include the needed input, calculations, and
output.
Insert your pseudocode here:

Ask user to input numeric values for radius


Radius will be inserted into spherical volume and surface area formulas
surface area 4πr², volume (4.0/3.0) π r3
Print results of both volume and surface areas

Part Two: Code the program. Use the following guidelines to code your program.
7. To code the program, use the Python IDLE.
8. Using comments, type a heading that includes your name, today’s date, and a short description
of the program.
9. Follow the Python style conventions regarding indentation and the use of white space to
improve readability.
10. Use meaningful variable names.

Example of expected output: The output for your program should resemble the following screen shot.
Your specific results will vary depending on the choices you make and the input provided.

Insert a copy of your code from IDLE here:

# Name: Daniel Romanov


# Date: 10/15/20
# Purpose of Program: to calculate new volume and surface area values for new basketball model sizes

from math import *


def main():
print("SportsBalls Inc. is designing a new type of basketballs. We need your help to input the
radii of the new ball sizes. Please input them below.")
x = input("What is the radius of the new ball model?")

vol = 4 * 3.14 * pow(int(x) , 2)


sur = 1.25 * 3.14 * pow(int(x) , 3)
print(str(x) + " to the power of 2 and multiplied by pi and 4" + " is " + str(vol) + ".")
print(str(x) + " to the power of 3 and multiplies by 3.14 and 1.25 is " + str(sur) + ".")

main()

Part Three: Complete the Post Mortem Review (PMR). Write thoughtful two to three sentence responses
to all the questions in the PMR chart.
Review Question Response
What was the purpose of your program? To have the user input the radius value to
determine the volume and surface areas of the
“basketball.”

How could your program be useful in the real Users can make custom sizes for their specific need
world? and wants.

What is a problem you ran into, and how did you My code wasn’t functioning correctly so I fixed my
fix it? mathematical functions and it worked

Describe one thing you would do differently the I would not delete everything on accident
next time you write a program.

You might also like