Assignment 5 - Timers and Conditionals
CpSc 130 Intro to Programming and Info Sys
Fall 2021

Due: November 15th
30 points

You are to create a web page that does simple kitchen conversions. A page with the html, form and Javascript setup has been created for your use. This kitchen converter needs to be completed.

First make the page dynamic so that the image in the upper left changes from this scale image to this scale image every second. A function named timerEvent() is set up in the code for you to complete.

Next, only when the radio button OK is clicked should any calculations be performed. When the user types in a value in the left text boxes (i.e., onchange()) then the appropriate function is called and the conversion performed.

The functions have been created and in each function a variable is assigned to assist you with the conversion. In each function you will need to:

Check if OK is true. If ok is true:

  1. set a variable (textAmt) to the value from the form (e.g., liters)
  2. if the textAmt is not a number then set it to 0
  3. set a Javascript variable (e.g.liters) to the floating point value of the textAmt
  4. set the form's value(s)
Partial Solution from Nov 12 class
Place the assignment in your cpscstorage02 folder named assign5 and name it as5.html