IT 116: Introduction to Scripting
Homework 3

Due

Sunday, February 11th 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 miles and stores it in the variable miles.
    Convert the value of miles using to an integer using int().
    Write an assignment statement that calculates the kilometer value and assigns it to the variable km.
    Use the formula above and the value of the variable miles.
    Convert km to integer using int().
    Print the value of km.
    Run the script to make sure it works properly.
    A miles value of 5 should give a kilometers value of 8.
    If it does not work, fix the problem.
  2. Write an assignment statement which asks the user for a value in kilometers and stores it in the variable km.
    Convert the value of km to an integer using int().
    Write an assignment statement that calculates the miles value and assigns it to the variable miles.
    Use the formula above and the value of the variable km.
    Convert miles to integer using int().
    Print miles.
    Run the script to make sure it works properly.
    A kilometers value of 8 should give a miles value of 5.
    If it does not work, fix the problem.
  3. Repeat the above to convert kilometers to miles.

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.