Part 1 – User Input (4 points) Prompt the user for the following input: The estimated miles driven per year The estimated price of a gallon of gas during the 5 years of ownership The initial cost of a hybrid car The efficiency of the hybrid car in miles per gallon The estimated resale value (a dollar amount) for a hybrid after 5 years The initial cost of a non-hybrid car The efficiency of the non-hybrid car in miles per gallon The estimated resale value (a dollar amount) for a non-hybrid after 5 years The user's buying criterion, either minimized "Gas" consumption or minimized "Total" cost. Assume the user will enter one of these two strings Make sure that you prompt in this same order. If you do not, you will be marked off. Verify that all numerical inputs are positive. You will need to check each number individually and reprompt immediately in the event of bad numeric input (including 0). Output a message that only positive numbers are valid and reprompt one more time. You may assume that the second value will be a positive number. Part 2 – Output Costs (12 points) For both cars, your program should output the following: A label indicating whether the car is Hybrid or Non-Hybrid The total gallons of fuel consumed over 5 years The total cost of owning the car for 5 years (fuel cost + depreciation in car value) For the last question you prompt for, if the user's criterion is "Gas", then provide the output for the car with the lower gas consumption first. If the criterion is "Total", then provide output for the car with the lowest total cost first. For every case, you will need to provide output for both vehicles, each with the total cost and the total gallons used. The points will be distributed as follows: Computing the correct fuel consumption (4 points) Computing the correct total cost (4 points) Printing in the correct order (4 points) Good Coding Style (4 points) Does your code exemplify the good coding habits taught in class? Requirement Notes: No magic numbers (any numeric literal, such as 5 or 3.
Stars
0
Forks
0
Watchers
0
Open Issues
0
Overall repository health assessment
No package.json found
This might not be a Node.js project
11
commits
2
commits
finish basic algorithm. Others can restyle as they see fit
7f749c7View on GitHubget html hooked up with javascript and get resell value to work
bd22b20View on GitHubadd radio buttons for what type of calculations to do instead of two buttons
44c9c0dView on GitHubMerge branch 'master' of github.com:StevenDewey/WTA_HybridvsNormalCar
8e60f8eView on GitHub