Ask Question

Write a program that will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your program will be reading in three double values. The first values are starting and ending temperatures. The third value is the increment value. There is no prompt for the input. There is an error message that can be displayed.

+1
Answers (1)
  1. 11 March, 22:36
    0
    start = float (input ())

    end = float (input ())

    increment = float (input ())

    if start 0:

    print ("Fahrenheit / t Kelvin / t Celsius")

    for f in range (int (start), int (end), int (increment)):

    k = 5.0/9.0 * (f - 32) + 273.15

    c = (f - 32) / 1.80

    print ("%.2f" % f + "/t/t" + "%.2f" % k + "/t/t" + "%.2f" % c)

    else:

    print ("Invalid input!")

    Explanation:

    The code is in Python.

    Let the user enter three values, start, end, and increment

    Check the values. If start is smaller than or equal to end and increment is greater than zero:

    Create a for loop that iterates between start and end with the increment value. Convert each of the value to kelvin and celsius using the formulas. Print the each value.

    Otherwise, print invalid input
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program that will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your program will be reading in three double ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers