Answered step by step
Verified Expert Solution
Link Copied!

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 32)/1.8
and the formula to convert a Celsius temperature to the Fahrenheit scale is
Fahrenheit = Celsius \times 1.8+32
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:
1. Open the provided `task1` folder in your code editor.
2. Use your code editor to open the task1.html and task1.js files from the task1 folder from the cloned repository. Enter your name and the date in the comment section of each file.
3. Go to the task1.html file in your code editor and in the head section add a script element to add the task1.js file(do the process of adding given External scripting file)
4. Go to the task1.js 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 32 and then divide by 1.8.
5. Create a function named CelsiusToFahrenheit() containing a single parameter named degree. Insert a statement that returns the value of the degree multiplied by 1.8 plus 32.
6. 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:
7. Declare a variable named cDegree equal to the value of the element with the id cValue.
8. Set the value of the element with the id fValue to the value returned by the CelsiusToFarenheit() function using cDegree as the parameter value.
9. 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:
10. Declare a variable named fDegree equal to the value of the element with the id fValue.
11. Set the value of the element with the id cValue to the value returned by the FarenheitToCelsius() function using fDegree as the parameter value.
12. Save your changes to the file.
13. Open task1.html in your web browser. Verify that when you enter 45 in the Temp in celsius box.
box and press Tab a value of 113 appears in the Temp in farnheit box.
14. Use git version control:
- Commit your changes to your local repository.
- Push the commits to your remote GitHub repository when the project is complete.
image text in transcribed

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

More Books

Students also viewed these Databases questions