IT 117: Introduction to Scripting
Homework 11

Due

Sunday, April 19th at 11:59 PM

What You Need to Do

Setup On Your Machine

Specification

Product Methods

__init__


get_name


get_sku


get_price


get_source

__str__

Dry_Good Methods

__init__


__str__

get_weight

Test Code

Output

Suggestions

  1. Create the file hw11.py.
    Write the class header for Product.
    Write the constructor for this class.
    Copy the test code to the bottom of the script.
    Comment out all line in the test code except the first.
    You comment out a line by making # the first character on the line.
    Run the script.
    Fix any errors you find.
  2. Write __str__.
    Remove the # from the 2nd line of the test code.
    Run the script.
    Fix any errors you find.
  3. Write get_name.
    Remove the # from the 3rd line of the test code.
    Run the script.
    Fix any errors you find.
  4. Write get_sku.
    Remove the # from the 4th line of the test code.
    Run the script.
    Fix any errors you find.
  5. Write get_price.
    Remove the # from the 5th line of the test code.
    Run the script.
    Fix any errors you find.
  6. Write get_source.
    Remove the # from the 6th line of the test code.
    Run the script.
    Fix any errors you find.
  7. Write the class header for Dry_Good.
    Write the constructor for this class.
    Remove the # from the 7th line of the test code.
    Run the script.
    Fix any errors you find.
  8. Write __str__.
    Remove the # from the 8th line of the test code.
    Run the script.
    Fix any errors you find.
  9. Write get_weight.
    Remove the # from the last line of the test code.
    Run the script.
    Fix any errors you find.

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.