Question

Write a program that displays a table of Celsius temperatures and equivalent Fahrenheit temperatures. You can find the formul

python

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:
The desired code in python with comments, sample screenshot and output is given.
Please comment if needs more clarity.

#temperature_conversion.py

#Python 3.8

# method to convert cel to fah
def convert_cel_to_fah( cel ):
    # formula to convert the temperature
    fah = (cel * 9/5) + 32
    return fah

# method to print data in tabular format
def print_temperature_table():
    print("     CEL     FEH")
    print("     ===     ===")
    temp = range(-40, 50, 10)
    for x in temp:
        # printing data in the format asked in the question
        print("%8.1f %8.1f" %(x,convert_cel_to_fah(x)))

#calling the parent function
# to print the table
print_temperature_table()


SCREENSHOT=>

OUTPUT=>


(plz give me a thums up...if my answer helped you and if any suggestion plz comment, Yr thums up boost me)

Add a comment
Know the answer?
Add Answer to:
python Write a program that displays a table of Celsius temperatures and equivalent Fahrenheit temperatures. You...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that displays a table of Celsius temperatures 0 through a number entered by...

    Write a program that displays a table of Celsius temperatures 0 through a number entered by the user and their Fahrenheit equivalents as in the figure below. The formula for converting a Celsius temperature to a Fahrenheit temperature is: F = 9 / 5 * C + 32 where F is the Fahrenheit temperature and C is the Celsius Temperature. Your program must use a 'for' loop. Display all temperatures to one decimal place. Write a program that displays a...

  • Write a program that displays a table of the Celsius temperatures 0 through 20 and their...

    Write a program that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit equivalents. use formula for converting celsius to faremnheit

  • In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as...

    In Python, write a program that converts Celsius temperatures to Fahrenheit temperatures. The formula is as follows: F=(9/5)C+32 The program should ask the user to enter a temperature in Celsius, then display the temperature converted to Fahrenheit.

  • in Java, temperature problem Create a package named temperature and create a program that has a...

    in Java, temperature problem Create a package named temperature and create a program that has a while loop. • • Inside the while loop, your program will prompt the user for temperature in Centigrade. If the Centigrade value read in is <= -100. the loop will exit. Otherwise, your program will compute the Fahrenheit equivalent temperature. Inside the while loop, your program will print out the Centigrade and Fahrenheit temperatures. Keep a count of the valid user inputs and a...

  • In Java. I am getting confused with this assignment, my confusion starts where I stopped. Create a package named tempera...

    In Java. I am getting confused with this assignment, my confusion starts where I stopped. Create a package named temperature and create a program that has a while loop. • Inside the while loop, your program will prompt the user for temperature in Centigrade. • If the Centigrade value read in is <= -100, the loop will exit. • Otherwise, your program will compute the Fahrenheit equivalent temperature. • Inside the while loop, your program will print out the Centigrade...

  • FOR PYTHON Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice...

    FOR PYTHON Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions. Both of these functions should be defined in a custom module named temps. Custom functionc_to_f should be a void function defined to take a Celsius temperature as a parameter. It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places. Custom function f_to_c should be a...

  • Write a C++ console application that displays a table of Celsius temperatures from 0 through 20...

    Write a C++ console application that displays a table of Celsius temperatures from 0 through 20 and their equivalent Fahrenheit temperature values. The formula for converting from Celsius to Fahrenheit is: [In C++ Please] F==C + 32 Where, C is the temperature value in Celsius, and F is the equivalent temperature in Fahrenheit. Your program must use a loop to display the temperature values.

  • Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The...

    Write a Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions. Both of these functions should be defined in a custom module named temps. Custom function c_to_f should be a void function defined to take a Celsius temperature as a parameter. It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places. Custom function f_to_c should be a value-returning...

  • Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit....

    Java program Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating- point number for the temperature and a character for the scale, eitherでfor Celsius or 'F' for fahrenheit. The class should have Four constructors: one for the number of degrees, one for the scale, one for both the degrees and scale, and a default constructor. For each of these constructors, assume zero degrees if no value is specified and celsius if no...

  • General overview This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin....

    General overview This program 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. This is discussed later. You need to display output for all of the values between the starting and ending values. First two values are...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT