Intro to Computer Science
Code due by Friday, January 27th at 11:00 AM submitted on eLearning
Your book spends a lot of time talking about problem solving. Let's look at how this would work, at least for some small problems (because you don't know enough to tackle big problems yet).
For small problems like we will be working with in this assignment, this process means that you:
In this assignment I would like you to :
Notes and requirements:
Customer Request #1 (mileage.py)
You are contacted by Dr. Otto Mobile who is analyzing the overall efficiently of a variety of American and Japanese cars. To help understand how they compare he has decided to calculate their MPG. You record the starting and ending mileage of the car, use this to calculate the total mileage driven, and then divide this by the amount of gas consumed.
For example, on a recent trip to visit my family my car's odometer was at 92567 when I left and 92783 when I returned. When I refilled the gas tank it required 10.6 gallons of gas. This comes out to 20.377 miles per gallon (my old car gets really bad mileage)
Dr. Mobile asks you to write a program that asks for the starting and ending mileage as well as the total gasoline consumed. It then calculates the MPG and prints a nice message regarding the MPG of the car.
Note: Your program should ask for the starting mileage first, the ending mileage second, and the total gasoline consumed last. Failure to following this ordering will result in some point deduction.
Customer Request #2 (time.py)
You are contacted by Dr. Tyme Aday who teaches time management at Whatsamata U. He wants a tool that will allow him to convert time in days, hours, minutes, and seconds into millieconds. Remember that:
He wants you to write a piece of code that prompts the user for number of days, hours, minutes, and seconds (in that order).
It then calculates the total number of milliseconds in the given days, hours, minutes, and seconds. (For example, 0 days, 0 hours, 1 minute, and 2 seconds has 62000 milliseconds.) The program should then print a nice message regarding the total number of milliseconds.
To upload your homework for grading, log on to eLearning, select this class, and navigate to the "Assignment Submissions" area. Click on the "Programming Assignment 1" folder and upload both python files (mileage.py and time.py) in the designated location.
Remember, no late work will be accepted. Start early!