148k views
1 vote
Write a program the converts degrees from Fahrenheit to Celsius, using the formula: DegreesC = 5(DegreesF −32)/9 Prompt the user to enter a temperature in degrees Fahrenheit as a whole number without a fractional part. Then have the program display the equivalent Celsius temperature, including the fractional part to at least one decimal point. A possible dialogue with the user might be

User Fahmi
by
4.2k points

1 Answer

3 votes

Answer:

Written in Python Programming Language

DegreesF = float(input("Temperature (Fahrenheit): "))

DegreesC = 5 * (DegreesF - 32)/9

print("Temperature (Celsius): ",end = '')

print("%.2f" % round(DegreesC, 2))

Step-by-step explanation:

This line prompts user for input in Fahrenheit

DegreesF = float(input("Temperature (Fahrenheit): "))

This line calculates the equivalent in degree Celsius

DegreesC = 5 * (DegreesF - 32)/9

The next two lines prints the calculated degree Celsius and approximates to two decimal places

print("Temperature (Celsius): ",end = '')

print("%.2f" % round(DegreesC, 2))

User Incongruous
by
4.6k points