IT 116: Introduction to Scripting
Homework 5

Due Sunday, February 25th at 11:59 PM


There is one deliverable for this assignment: It must be in an hw5 directory, which you must create inside a hw directory inside your it116 directory.

Make sure the script obeys all the rules in the Script Requirements page.


Write a program that prints a table of Celsius temperatures from 0 to 20 degrees and prints the corresponding temperature in Fahrenheit.

This program MUST use a loop.

You MUST use the Python round function on the Fahrenheit value so only integer values appear in the tables.

Each column must have a label at the top specifying Celsius and Fahrenheit and their must be a line between these column labels and the data that follows.

The first digit in each temperature must line up with the labels for each temperature so the output forms neat columns.


  1. Write a loop that runs from 0 to 20 and have it print out those values.
    These are the Celsius values.
    Run the script and fix any errors.
  2. Add a formula to the loop which converts a Celsius temperature into a Fahrenheit temperature.
    Make sure the result is an integer.
    Change the print statement so it prints both temperatures.
    Run the script and fix any errors.
  3. Add a tab or use the format function to the print statement so both temperatures will be aligned in vertical columns.
    Run the script and fix any errors.
  4. Add a print statements before the loop that prints the name of the temperatures and a line of dashes, -.
    Run the script and fix any errors.


Your output should look like this
Celsius	Fahrenheit
0	32
1	34
2	36
3	37
4	39
5	41
6	43
7	45
8	46
9	48
10	50
11	52
12	54
13	55
14	57
15	59
16	61
17	63
18	64
19	66
20	68
Be sure to run this script on the Unix machine so you know it works in the environment in which I will run it when I score your homework.