Write a program that helps a person decide on whether to buy a hybrid car.
thumb You should ask the user for input. Your program's inputs should be
Your program's output should be
You can then run your program with the cost, gas mileage, and resale value for a normal car and a hybrid car and determine which is less expensive.
Before you can write code, you will need to decide on how to solve this problem by hand. Write pseudo code that shows what you would do by hand. Then convert this pseudo-code into a program.
If you get stuck:
Compute the total cost of owning the car for 5 years. (For simplicity, we will not take the cost of financing into account.) Obtain realistic prices for a new and used hybrid and a comparable car from the Web. Run your program twice, using today's gas price and 15,000 miles per year.
When you have your program working, you will need to show it to a TA. The TA will evaluate your code based on the following criteria and his/her own input values:
Assume that
What gas mileage would a new hybrid ($32,000) need to have in order for total costs for 5 years to be equal to the total costs for a normal car? Test different values in your program to find the correct answer. (1 point)
WHEN YOU PASS OFF, you will need to submit your code. To do this follow the instructions below:
.
If you have trouble, ask a neighbor or a TA.
You can save the files to the desktop and then attach them to an email.
An example pass-off form is shown below for this lab. You will find printed pass-off forms in 1119 TMCB.