01 Prove Milestone: Review Python

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.

For all assignments in CSE 111, please write your program in a file named as the assignment states. This assignment requires you to name your program tire_volume.py. If you name your program something else, it will be harder for the graders to score your submitted assignment.

Help

If you’re having trouble completing this assignment, reading related online documentation, using a generative AI as a tutor, or working with a human tutor will help you complete it.

Helpful Documentation

Help from an AI Tutor

You could use a generative AI as a tutor to help you write and troubleshoot your program. Bro. Lee Barney created a custom Chat GPT named Pythonista that is fine-tuned to focus on Python functions, loops, if statements, and related programming concepts. If your program is generating an error, ask Pythonista a question like this:

I'm writing a Python program that computes the approximate volume of air in a tire. When I run my program, it causes the following error. Please suggest some mistakes that might cause this error.

(Copy and paste the error message here.)

You could also ask Pythonista a question about one of your functions, like this:

I wrote the following Python function that is supposed to (type a short description here). However, the function isn't (type what it's not doing correctly here). Please help me fix this function.

(Copy and paste your Python function here.)

Help from a Human Tutor

As a BYU-Idaho campus or online student you can get help from a tutor to complete your CSE 111 assignments. Each tutor is a current BYU-Idaho student employed by BYU-Idaho. 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. Campus students meet with tutors in the tutoring center. Online students meet with tutors in Zoom. To make an appointment, follow the instructions in the course tutoring guide.

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 I‑Learn and report your progress on this milestone.