Write an algorithm that displays a series of the Celsius temperatures 0 through a termination value and their Fahrenheit equivalents. The formula for converting a temperature from Celsius to Fahrenheit equivalents. The formula for converting a temperature from Celsius to Fahrenheit is
F = 9/5 C + 32
Where F is the Fahrenheit temperature and C is the Celsius temperature. Your algorithm must use a loop to display the series.
Sample Output of the program is given below.
Enter the highest Celsius temperature value: 5
Fahrenheit equivalent of 0 is 32
Fahrenheit equivalent of 1 is 33.8
Fahrenheit equivalent of 2 is 35.6
Fahrenheit equivalent of 3 is 37.4
Fahrenheit equivalent of 4 is 39.2
Fahrenheit equivalent of 5 is 41
Start
Declare variable highestCelsiusTemperature
Declare variable F
Display message: "Enter the highest Celsius temperature value: "
Read highestCelsiusTemperature
for C =0 to highestCelsiusTemperature
F = 9/5 * C + 32
Display message "Fahrenheit equivalent of "+C+" is "+F
end for
Stop
Comments
Leave a comment