Write a program (lab3.cpp) that finds the temperature that is the same in both Celsius and Fahrenheit. The formula to convert from Celsius to Fahrenheit is: ??ℎ???ℎ??? = (9 ∗ ???????/5)+32 Your program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degree Celsius. In a loop, decrement the Celsius value and compute the corresponding temperature in Fahrenheit until the two values are the same. An example run of this program is attached as a photo 1. What is the condition that will end the loop? 2. Should you check that condition at the beginning or end of the loop? 3. What kind of loop is best for that kind of condition checking?
Write a
Fahrenheit. The formula to convert from Celsius to Fahrenheit is:
??ℎ???ℎ??? = (9 ∗ ???????/5)+32
Your program should create two integer variables for the temperature in Celsius and Fahrenheit. Initialize the temperature to 100 degree Celsius. In a loop, decrement the Celsius
value and compute the corresponding temperature in Fahrenheit until the two values are the same. An example run of this program is attached as a photo
1. What is the condition that will end the loop?
2. Should you check that condition at the beginning or end of the loop?
3. What kind of loop is best for that kind of condition checking?
Step 1 : START
Step 2 : declare variables
Step 3 : set the initial value of celsius
Step 4 : now using for loop and condition , equivalent values are printed
Step 5 : STOP
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images