IT 117: Introduction to Scripting
Homework 9

Due

Sunday, April 5th at 11:59 PM

What You Need to Do

Setup On Your Machine

Specification

Methods

__init__

get_title


get_studio


get_director


get_released


__str__

Test Code

Output

Suggestions

  1. Make a copy of your hw8.py file in your hw9 directory.
    Change the name of this file to hw9.py
    Remove all the test code from hw9.py
    Run the script.
    You should see nothing. Fix any problem you find.
  2. Change __init__ by adding the parameter released.
    Copy the first line of the test code to the bottom of your script.
    Run the script.
    You should see nothing. Fix any problem you find.
  3. Change __init__ and get_title so the attribute title is hidden.
    Copy the 2nd line of the test code to the bottom of your script.
    Run the script.
    Fix any problem you find.
  4. Change __init__ and get_studio so the attribute studio is hidden.
    Copy the 3rd line of the test code to the bottom of your script.
    Run the script.
    Fix any problem you find.
  5. Change __init__ and get_director so the attribute director is hidden.
    Copy the 4th line of the test code to the bottom of your script.
    Run the script.
    Fix any problem you find.
  6. Change __init__ so it sets the value of the attribute released.
    Create the method get_released that returns the value of this attribute.
    Copy the 5th line of the test code to the bottom of your script.
    Run the script.
    Fix any problem you find.
  7. Remove the method print_dvd.
    Replace it with the method __str__ which returns a string containing the values of each of the attributes.
    Copy the last line of the test code to the bottom of your script.
    Run the script.
    Fix any problem you find.

Testing on Your Machine

Copy the Script to Unix

Testing the Script on Unix (Optional)

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