IT 116: Introduction to Scripting
Homework 3

Due

Sunday, September 21st 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 Kelvin and assigns it to the variable kelvin.
    Use the formula above and the value of the variable fahr.
    Write a print statement to print "Kelvin" and the rounded Kelvin value.
    Save the file and quit.
    Run the script to make sure it works properly.
    A Fahrenheit value of 30 should give a Kelvin value of 272.
    A Kelvin value of 272 should give a Fahrenheit value of 30.
    If it does not work, fix the problem.
  3. Repeat the above steps for the Kelvin 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.