CSC111 Homework 10 2011

From dftwiki3
Revision as of 12:41, 29 November 2011 by Thiebaut (talk | contribs) (Created page with "--~~~~ ---- <bluebox> This is an A/E type of homework. You have several problems to solve. You either get an A or an E on each one. What is important here is Python, not docu...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

--D. Thiebaut 12:41, 29 November 2011 (EST)


This is an A/E type of homework. You have several problems to solve. You either get an A or an E on each one. What is important here is Python, not documentation (this is an exception to the rule). You have to solve different problems and make your program output the correct answer. Correct answers get A, incorrect ones get E. I will not read the code closely, and will not take point for lack of documentation. The goal here is for you to use classes and objects and make them work.
This assignment is due Dec. 6 evening, at midnight.


Problem 1

  • Modify the car class we saw in class (some code available on the class Web page), and make the class contain a rectangle for the body, a rectangle for the window (or windows), and a move() method, so that we can make the car move out of the screen with this loop:
     for i in range( 1000 ):
          car.move( 2, 0 );
(we assume that car is an object instantiated from the class Car.)