46.7k views
2 votes
Write a converter program for temperatures. This program should prompt the user for a temperature in Celsius. It should then convert the temperature to Fahrenheit and display it to the screen. Finally, it should convert the Fahrenheit temperature to Kelvin and display that to the screen.

1 Answer

7 votes

Answer:

c = float(input("Enter the temperature in Celsius: "))

f = c * 1.8 + 32

print("The temperature in Fahrenheit: " + str(f))

k = (f - 32) / 1.8 + 273.15

print("The temperature in Kelvin: " + str(k))

Step-by-step explanation:

*The code is in Python.

Ask the user to enter the temperature in Celsius

Convert the Celsius to Fahrenheit using the conversion formula and print it

Convert the Fahrenheit to Kelvin using the conversion formula and print it

User Matt Pileggi
by
3.9k points