Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Project Description: In this project you will create an application to convert temperature readings between Fahrenheit and Celsius and between Celsius and Fahrenheit. The formula
Project Description:
In this project you will create an application to convert temperature readings between Fahrenheit and Celsius and between Celsius and Fahrenheit. The formula to convert a Fahrenheit temperature to the Celsius scale is
Celsius Fahrenheit
and the formula to convert a Celsius temperature to the Fahrenheit scale is
Fahrenheit Celsius times
Users will enter a value in a Celsius or Fahrenheit input box, press the Tab key, and have the other input box automatically show the temperature reading in the other scale. A preview of the completed page is shown below
Instructions:
Open the provided task folder in your code editor.
Use your code editor to open the taskhtml and taskjs files from the task folder from the cloned repository. Enter your name and the date in the comment section of each file.
Go to the taskhtml file in your code editor and in the head section add a script element to add the taskjs filedo the process of adding given External scripting file
Go to the taskjs file in your code editor. Create a function named FahrenheitToCelsius containing a single parameter named degree. Insert a statement that returns the value of degree minus and then divide by
Create a function named CelsiusToFahrenheit containing a single parameter named degree. Insert a statement that returns the value of the degree multiplied by plus
Add an onchange event handler to the element with the id cValue Attach an anonymous function to the event handler and within the anonymous function do the following:
Declare a variable named cDegree equal to the value of the element with the id cValue
Set the value of the element with the id fValue to the value returned by the CelsiusToFarenheit function using cDegree as the parameter value.
Add an onchange event handler to the element with the id fValue Attach an anonymous function to the event handler and within the anonymous function do the following:
Declare a variable named fDegree equal to the value of the element with the id fValue
Set the value of the element with the id cValue to the value returned by the FarenheitToCelsius function using fDegree as the parameter value.
Save your changes to the file.
Open taskhtml in your web browser. Verify that when you enter in the Temp in celsius box.
box and press Tab a value of appears in the Temp in farnheit box.
Use git version control:
Commit your changes to your local repository.
Push the commits to your remote GitHub repository when the project is complete.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started