Assigned: Friday, September 6
Due: Thursday, September 12, 2019 by 11:55pm (on Moodle)
The City of Memphis offers a number of options for electric scooter rentals. As an avid rider, you're always trying to determine the most
cost-effective option for your scooter riding needs. Each option requires that the user knows about how long they will be using the scooter.
Since it is easier for users to look up the distance they need to travel, the user will enter the total distance of their trip and you will
calculate the total time it will take (assume an average pace of 15 mph). Using the following cost schemes, calculate the total cost of the ride for each company and tell the
user which company they should use.
Company A: $1 + $0.15/minute of use Company B: $2.50 for the first 5 minutes + $0.12/minute for every minute after Company C: $5 + $0.06/minute of use |
Your code does not need to follow this script verbatim, but all the mentioned functionality should work as shown.Test 1
(Program begins) Do you want to enter distance as miles or kilometers (type m or k): m How many miles would you like to scooter? 10 That is 16.0934 kilometers. Total time in minutes: 40.0 You should use Company B. It will cost $6.70. (Program ends)Test 2
(Program begins) Do you want to enter distance as miles or kilometers (type m or k): k How many kilometers would you like to scooter? 7.5 That is 4.6602955248735505 miles. Total time in minutes: 18.641182099494202 You should use Company A. It will cost $3.80. (Program ends)Test 3
(Program begins) Do you want to enter distance as miles or kilometers (type m or k): M How many miles would you like to scooter? 15.8 That is 25.427572 kilometers. Total time in minutes: 63.20000000000001 You should use Company C. It will cost $8.79. (Program ends)
Your program will be graded on correctness, as well as on coding style, which refers to choices you make when writing your code, such as good use of variable names, appropriate indentation, and comments (this is not an exhaustive list). See the syllabus for further grading details.
You will receive one bonus point for every complete day your program is turned in early, up to a maximum of five points. For instance, if your program is due on September 20 at 11:59pm, if you turn in your code on Moodle any time on September 19 from 12:00am through 11:59pm, you will receive one extra point on your project. Programs submitted on September 18 from 12:00am through 11:59pm will receive two points. This pattern continues for up to five points.