Lab 3
Lab 3
Overview
The purpose of today’s lab is to create a JavaScript to practice taking input from the user and returning output
to the user. This lab will also allow you to practice using functions to accomplish small programming tasks.
Instructions:
Complete the following exercises individually. Please follow the instructions carefully and complete all of the
steps.
• There are two buttons. The first button will convert from Farenheit to Celsius and the second
Celsius to Farenheit.
• If the user clicks on the F to C button, prompt them for a temperature in degrees Farenheit.
Then, in the output div, display a message such as
• 50 degrees F is equal to 10 degrees C.
• If the user clicks on the C to F button, the user should be asked for a temperature in Celsius
and display the conversion to Farenheit.
• Use the following formulas to do this.
• C = (F – 32) * 5 / 9
• F = (C * 9 / 5) + 32
Test that your JavaScript correctly executes for all of the problems by opening lab3.html in the browser
and testing all of the buttons.
Submission
• When you have completed all the exercises, call over the instructor or lab assistant. Be prepared to explain
or elaborate on any of the questions you answered in this exercise. You must complete as many exercises
as possible before leaving the lab today. No late exercises will be accepted. If unfinished during the lab, then
submit to D2L by end of the same day.
Grading
Marks will be assigned as follows:
o 3 marks for correctly implementing exercise A
o 3 marks for correctly implementing exercise B
o 3 marks for correctly implementing exercise C
o 4 marks for correctly implementing exercise D
o 2 marks for proper indentation and formatting