Homework 2

Due: September 13 th
10 points

This homework is to refresh your skills with Javascript. You are still not to use any extra libraries or CSS.

Assume the distance from Slippery Rock to Grove City is 8 and one third miles and the speed limit is 55 mph the entire way.
The amount of time it takes to drive that distance in hours is:

t0 = 8 1/3 ÷ 55
Suppose that I find a place very near the beginning of my drive that is not curvy or hilly and there are no kids or deer around and I decide to pass the car in front of me so I can drive 65 mph. The time is now:
t1 = 8 1/3 ÷ 65
The amount of time I saved (in hours) is t0 – t1. To see that in seconds, I would multiple by 3600.

Create a simple web page that will show how much time can be saved by driving at a particular speed (over 55).

In this assignment use: Extra credit: provide an initial value (as an example) in the input box that is erased as soon as the user clicks in the box and your function uses isNaN() to print an error message when appropriate.

Tip – use a variable for the distance that calculates 8 + 1 / 3. (How many significant digits would you need to approximate as, say, 8.333?)
To hand in the assignment, move all components of the Phonegap structure to the homework2 dropbox on D2L. Zip the entire Phonegap structure - make sure both the zip file and the project name are short.