Make the following changes to your JavaScript:
// noprotectThis is only needed in JSBin, not in later assignments in Visual Studio Code.
TempConverter
with a property called tempF
and set it to an initial value of 0.TempConverter
called calcTemp
that converts the object's tempF
property to Celsius, and returns the value calculated.TempConverter
called getTemp
. It should:
if
statement to test whether or not the temperature is a valid number. Investigate the isNaN()
function.
alert()
function to indicate the problem. Then return the boolean value false
.tempF
property to the value entered by the user, call the object's displayTemp
method (created in the next step), then return the boolean value true
.displayTemp
method to display the converted temperatures. In it:
\n
)\t\t
)calcTemp
that you wrote previously.tempF
each time with the next Fahrenheit value lower by 5.getTemp()
method and assign the returned value to a variable.while
loop to check if the returned value is false. If so, perform the above step until the returned value is true.JavaScript should be properly formatted following coding conventions discussed in class.
Your results should look something like this:
You will be graded on:
The lab will begin with a full score of 25 points and deductions will be made according to the amount and severity of errors.