Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you please add error checking for erroneous Fahrenheit values in HTML using the code. Below is the code and some notes provided. Thank you:

Can you please add error checking for erroneous Fahrenheit values in HTML using the code. Below is the code and some notes provided. Thank you:

JavaScript Celsius to Fahrenheit and vice-versa program

Insert a number into one of the input fields below:

degrees Celsius

degrees Fahrenheit

Note that the Math.round() method is used, so that the result will be returned as an integer.

Notes:

  1. The two lines that start with

    a. After the user clicks in a textBox, which constitutes an event, each subsequent keystroke (actually onkeyup events) causes the capital letter (C or F) to be passed to the convert() function

    b. The convert() function then obtains the value in the textBox, via document.getElementById(XX).value, where XX is either the passed string C or F

  2. Typing is implicit, but type can be determined at runtime see code below

  3. C, F, and john are strings in JavaScript see code below

  4. EXERCISE: Update the program above to add error checking for erroneous Fahrenheit values

  5. The const statement sets a constant

  6. If a value below absolute zero is entered into the Celsius text box, the Fahrenheit box is set to Invalid Temperature

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions