Introduction
In this lab, we will explore and practice various concepts in JavaScript programming. We will cover topics such as data types, variables, conditional statements, loops, functions, and objects. By the end of the lab, you will have a strong foundation in JavaScript that will enable you to create dynamic and interactive web applications.
Conversion of Celsius to Fahrenheit
To convert Celsius to Fahrenheit using coding, follow these steps:
- Open the Terminal/SSH.
- Type
node. - Use the conversion formula:
F = 1.8 * C + 32. - Implement the formula using the following code:
const celsiusToFahrenheit = (degrees) => 1.8 * degrees + 32;
- Test the function by entering a value in degrees Celsius, like this:
celsiusToFahrenheit(33); // 91.4
This will output the corresponding value in degrees Fahrenheit.
Summary
Congratulations! You have completed the Celsius to Fahrenheit lab. You can practice more labs in LabEx to improve your skills.