Skip to content

Instantly share code, notes, and snippets.

@egunawan
Last active April 24, 2017 00:06
Show Gist options
  • Save egunawan/9d1b87acbb93bdb8905959cf0311e52e to your computer and use it in GitHub Desktop.
Save egunawan/9d1b87acbb93bdb8905959cf0311e52e to your computer and use it in GitHub Desktop.
Week 12 Reading Homework for MCS-177 Intro to CS 1 Spring 2017

Week 12 Monday Reading Homework

  • Skim-read Sec 10.2.2-10.2.3 (Object-oriented programming and Python classes, pg 330-332)

  • Try the magic methods __getitem__ and __add__ for the familiar int and list classes by typing out the boxed Sessions 10.1 and 10.2 on pages 331-332.

  • Skim-read Sec 10.3.1-10.3.3 (the constructor method, accessor methods, and mutator methods, pg 333-339)

  • Try out creating the Planet class by typing out Listing 10.1 and Session 10.3 on page 334.

  • Add accessor methods to your Planet class - type out Listing 10.2 and Session 10.4 on page 336.

  • Add mutator methods to your Planet class - type out Listing 10.4 and Session 10.6 on page 339.

  • Suggested exercises: Do exercises 10.1-10.3, 10.4, 10.5ab p. 338 and exercises 10.11 p. 340 and save them in a file.

  • Suggested alternative reading (if you prefer the online interactive textbook over our paper textbook): skim-read and click run on the six pages Sec 16.2 - 16.6 of the online interactive textbook http://interactivepython.org/runestone/static/thinkcspy/ClassesBasics/toctree.html

  • (REQUIRED) DO the following reading quiz (unlimited attempts on 12 multiple-choice questions) and submit: https://moodle.gac.edu/mod/quiz/view.php?id=51910 (The quiz will be open until Monday 5pm)

Note: Understanding Python class may not be easy at first (even if you've done programming before), so we will devote many hours to this during for the rest of April and part of May.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment