Difference between revisions of "CSC111 Homework 10 2011"
(→Problem 1) |
(→Problem 1) |
||
Line 22: | Line 22: | ||
:(we assume that '''car''' is an ''object'' instantiated from the ''class'' Car.) | :(we assume that '''car''' is an ''object'' instantiated from the ''class'' Car.) | ||
+ | * Make your program implement this loop so that we can see the car move out of the window. | ||
* Store your program in a file called '''hw10a.py''' and submit it this way: | * Store your program in a file called '''hw10a.py''' and submit it this way: | ||
Revision as of 12:50, 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.
Contents
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 cab part,
- a rectangle (or rectangles) for the window (or windows),
- a Text caption in the middle of the body (s.a. "Taxi" ),
- 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.)
- Make your program implement this loop so that we can see the car move out of the window.
- 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