hts.StevenWood.com

[ Last Page ]

Karel: Test #1 Review

Format:

Hand written NO computer

Approximate breakdown    
True / False 10 marks
Fill in the blank 12  
Short answer 17  
Long answer 11  
  -------  
Total 50 marks

Covers:

  1. Extend a current class (e.g. extend Robot or ExperimentRobot for example).
  2. Create a constructor.
  3. Create a method that overrides a current capability (e.g. change turnLeft() in FastBot) or adds new functionality (e.g. turnRight() in ExperimentRobot).
  4. Create the class file for a new type of robot given a description of the robot.
  5. Create a 'tester' class to test a robot.
  6. Instantiate a Wall, Robot, Lamp or Thing object.
  7. Create a city file.
  8. Use a city file to instantiate a City object.
  9. Know how to interpret a class diagram.
  10. What are the basic required comments for a program and where to place them in the program. Don't forget the ones that describe each method!
  11. Simple DOS window program to print out information as in Assignment 2-2.
  12. Simple graphics objects. e.g. draw a rectangle, draw a filled in oval, etc.
  13. The main method for the graphics program
  14. WILL NOT INCLUDE hardware section.

 

Terms to know:

class method import extend class diagram
super/sub class parent/child class System.out println() print()
super this override constructor fillOval
fillRect drawLine JFrame setColor setVisible
drawOval drawRect drawArc setContentPane awt
swing setLocation comments fillArc setSize
         
         

 

Questions to try:

  1. Section 1.9 Problem Set. Exercise 1.16.

  2. Section 2.10 Problem Set. Exercise 2.7, 2.9, 2.12. Some of these questions use RobotSE. RobotSE is a new robot for us to use and it knows how to turn right and turn left, turn around and many other things.



  3. Make a new robot that adds to the capabilities of Robot. This robot knows how to move backwards one space (like 2.7) but really fast. Set the speed to a large number.
  4. Make a city that has 3 walls that contain a thing. Put a lamp in the city and a robot above the lamp. Program the robot so that it goes and picks up the thing and then goes back and puts it down where it started. Do this using a plain robot.
  5. Make a WrongWayBot that extends RobotSE. RobotSE is a new robot for us to use and it knows how to turn right and turn left. A WrongWayBot will turn left when commanded to turn right and turn right when commanded to turn left. Use the city file 'RichmondHill.txt' to create the city and then pick up all of the items.
     
  6. Create a small city file.
  7. Use a city file.
  8. Get Java print out your name 2 times.
  9. Draw a circle, square, oval, rectangle, line and arc. Outline and filled.
  10. Create a custom colour and use it. Use a "built-in" colour too.
 
[Last Page]
All material on this site is copyright © 1997- by Steven Wood or as credited. All right reserved. Use of this site indicates you agreement with the  terms of use.
Send comments or questions to about this page.
Every attempt has been made to credit work under copyright. If there are any claims that copyright has been missed please contact the .
+SDG+