Continue working on the JavaScript Advanced Calculator we started building in class. Add the following features...
This feature asks the user for four inputs:
- Distance – how far will you drive?
- MPG – what is the fuel efficiency of the car?
- $PG – how much does gas cost per gallon?
- Speed – how fast will you drive?
The output is a string: “Your trip will take 3.5 hours and cost $255.33.”
For every 1 MPH over 60 MPH, reduce the the MPG by 2 MPG (i.e. a car that normally gets 30 mpg would only get 28 mpg if its speed were 61 mph. Yes this gets silly at high speed where mpg goes to zero or gets negative.)
Calculate the BMI when given the height and weight - the user should be able to choose between the imperial and the metric system
http://en.wikipedia.org/wiki/Body_mass_index
Calculate the monthly payment when given the other variables as input. you need principal, yearly interest rate and the number of payments http://www.wikihow.com/Calculate-Mortgage-Payments
If you have time:
- make sure all displayed numbers are rounded to 2 decimal places at most