MIT | MIT-AITI | Ethiopia 2004

Java Lab 9: Racecar - Part II

  1. Create a new package called race. Move Racecar.java into the package folder and add a package statement to Racecar to declare it a member of that package. Compile and run.
  2. Create a new package called easyreader. Copy EasyReader.java into the package folder and add a package statement to EasyReader to declare it a member of that package. Compile.
  3. Add an import statement to Racecar that imports the EasyReader class. Compile Racecar.
  4. The EasyReader documentation is available from the EasyReader webpage; it is the API for the EasyReader class. Take at a look at it. Referencing the API as needed, change the main method in Racecar to make a more interactive racing game. If you want, you could allow users to choose the color and speed of their cars and construct races. Or you could do something completely different. Be creative. Feel free to change the Racecar class or add other classes to the race package.

Submission: Submit all of your code for this lab.

Hosted by www.Geocities.ws

1