Question: Write a Python program (celsius_to_fahrenheit_table) that converts the temperature in Celsius to Fahrenheit and prints the output in a table. The provided template file runs

Write a Python program (celsius_to_fahrenheit_table) that converts the temperature in Celsius to Fahrenheit and prints the output in a table. The provided template file runs perfectly, download it and test in your machine.

You need to modify the template file to output two columns. In the first column, it prints out the temperature in Celsius, and the second in Fahrenheit. Have the data print out all integer values of Celsius in range specified by the user. The user can specify the start, end, and increments. Also, have the data print out the Fahrenheit to 1 decimal point.

In your program, include two functions:

(1) c_to_f: This function has one parameter (degree in Celsius) and returns the degree in Fahrenheit. (Submit for 2 points).

(2) __main__: In the main, you should do the following: (Submit for 8 points)

a. Print instruction statement that says: "This program converts the temperature in Celsius to Fahrenheit."

b. Prompt the user to input a number (start), as the first Celsius temperature in the range.

c. Prompt the user to input a number (end), as the last Celsius temperature in the range.

d. Prompt the user to input a number (increments), as the degree increments for Celsius.

e. Call the function c_to_f to convert each Celsius temperature, based on the value in b, c and d

Note: When printing the numbers, use this format {:<8d}{:>s} {:>3.1f}' in print statement. This means the following: (1) '<' means the field will be left-aligned within the available space, (2) '>' means the field will be right-aligned within the available space, (3) the available spaces are the numbers after < and >, (4) and d, s, f are for integer decimal, string, and float.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!