Challenge: Temperature Conversion
Test yourself and implement what you have learned so far in this challenge.
We'll cover the following
Problem Statement
You are given a variable fahrenheit
which stores a temperature in degrees Fahrenheit. You have to create a variable celsius
which converts the temperature stored in fahrenheit
to degrees Celsius.
To convert temperature from degrees Fahrenheit to degrees Celsius, you first need to subtract the temperature by 32 and then multiply it by 5 divided by 9.
Input
The input is the variable fahrenheit
.
fahrenheit
has already been declared for you.
Output
The output will be the value assigned to Celsius
.
Sample Input
50.0
Sample Output
10.0
Test Yourself
Write your code in the given area. Try the exercise by yourself first, but if you get stuck, the solution has been provided. Good luck!
// Rewrite celsiusval celsius = "temp"
Let’s go over the solution review in the next lesson.