CSE 111: Programming with Functions

W01 Prove Milestone: Tire Volume

Purpose

Prove that you can write a Python program that gets input from a user, performs arithmetic, and displays results for the user to see.

Problem Statement

The size of a car tire in the United States is represented with three numbers like this: 205/60R15. The first number is the width of the tire in millimeters. The second number is the aspect ratio. The third number is the diameter in inches of the wheel that the tire fits. The volume of space inside a tire can be approximated with this formula:

v =
π w2awa + 2,540 d
10,000,000,000

If you’re curious about how the above formula was derived, you can read the tire volume formula derivation.

Assignment

Write a Python program named tire_volume.py that reads from the keyboard the three numbers for a tire and computes and outputs the volume of space inside that tire.

Helpful Documentation

Help from a Tutor

As a BYU-Pathway student you can get help from a tutor to help you complete your CSE 111 assignments. Each tutor is a current student employee. Meeting with a tutor is free. It will not cost you any money to meet with a tutor. To get help from a tutor, you simply make an appointment and then meet with the tutor. Tutors typically use Zoom to meet with students. To make an appointment, use the tutoring link on the course home page.

Testing Procedure

Verify that your program works correctly by following each step in this testing procedure:

  1. Run your program and enter the inputs shown below. Ensure that your program’s output matches the output below.
    > python tire_volume.py
    Enter the width of the tire in mm (ex 205): 185
    Enter the aspect ratio of the tire (ex 60): 50
    Enter the diameter of the wheel in inches (ex 15): 14
    The approximate volume is 24.09 liters
    > python tire_volume.py
    Enter the width of the tire in mm (ex 205): 205
    Enter the aspect ratio of the tire (ex 60): 60
    Enter the diameter of the wheel in inches (ex 15): 15
    The approximate volume is 39.92 liters
    

Ponder

During this assignment, you wrote a Python program that gets input from a user, uses variables, performs arithmetic, and displays results for the user to see. Because you should have learned how to write this type of program in CSE 110, this assignment should have been fairly easy for you. If this assignment was difficult for you, you should review the concepts from CSE 110 and the programs that you wrote in that course.

Submission

On or before the due date, return to Canvas and report your progress on this milestone.

Up Next

Other Links: