Difference between revisions of "CSC111 Homework 10 2011"

From dftwiki3
Jump to: navigation, search
(Problem 1)
(Problem 1)
Line 9: Line 9:
 
<br />
 
<br />
 
=Problem 1=
 
=Problem 1=
 
+
[[File:TaxiCabCSC111.png|100px|right]]
* 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:
+
* 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 cab part, 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( 500 ):
 
       for i in range( 500 ):

Revision as of 12:48, 29 November 2011

--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

TaxiCabCSC111.png
  • 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 cab part, 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( 500 ):
          car.move( 2, 0 );
(we assume that car is an object instantiated from the class Car.)
  • Store your program in a file called hw10a.py and submit it this way:
    rsubmit hw10 hw10a.py           (if you are working on beowulf)
or use the http://cs.smith.edu/~111a/submit10.htm submit form.


Problem 2

TBA

Problem 3

TBA

Problem 4

TBA