IT 116: Introduction to Scripting
Homework 3

Due

Sunday, February 16th 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 value in inches and stores it in the variable inches.
    Convert the value of inches using int().
    Write a print statement to print the value of inches.
    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 centimeters value and assigns it to the variable cm.
    Use the formula above and the value of the variable inches.
    Write a print statement to print the rounded Centimeter value.
    Save the file and quit. Run the script to make sure it works properly. An inches value of 6 should give a centimeters value of 15.
    A centimeters value of 15 should give a inches value of 6. If it does not work, fix the problem.
  3. Repeat the above to convert centimeters to inches.

Testing on Your Machine

Copy the Script to Unix

Testing the Script on Unix (Optional)

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