IT 116: Introduction to Scripting
Homework 3

Due

Sunday, September 22nd at 11:59 PM

What You Need to Do

Setup On Your Machine

Specification

Output

Suggestions


  1. Write an assignment statement which asks the user for a temperature in Fahrenheit and stores it in the variable fahr.
    Convert the value of fahr using int().
    Write a print statement to print the value of fahr.
    Save the file and quit.
    Run the script to make sure it works properly.
    If it does not work, fix the problem.
  2. Write an assignment statement that calculates the value the of the temperature in Celsius and assigns it to the variable celsius.
    Use the formula above and the value of the variable fahr.
    Write a print statement to print the rounded Celsius value. Save the file and quit.
    Run the script to make sure it works properly. A Fahrenheit value of 40 should give a Celsius value of 4.
    A Celsius value of 4 should give a Fahrenheit value of 39.
    If it does not work, fix the problem.
  3. Repeat the above steps for the Celsius to Fahrenheit conversion.

Testing on Your Machine

Copy the Script to Unix

Testing the Script on Unix (Optional)

Copyright © 2022 Glenn Hoffman. All rights reserved. May not be reproduced without permission.