CSSE 220 – Object-Oriented Software Development

Homework 18

Objectives

Practice with interfaces and implementing them.

Tasks

  1. Complete the assigned reading for the next session, according to the course schedule.

  2. Complete the assessment exercise over this reading on ANGEL (under Lessons → Assignments). This assessment is longer than most, please budget additional time for it.
  3. Programming from last time: Finish the BigRational exercise from Homework 17.
  4. More Programming:
    1. Your programming work for this part must be done in the EventBasedProgramming project inside Eclipse. Use the SVN Repository Exploring perspective to check out this project, then switch back to the Java perspective.
    2. In-class exercises:
      1. Complete the TODO items in slides.BreakfastMain.
      2. Complete the TODO items in the new edu.roseHulman.csse220.charges package.
    3. Board Games: The package boardGames contains an interface Game for two-player board games with a graphical interface. An implementation of TicTacToe based on this interface is provided, as is a GameRunner component and a main class, GameMain. You have four tasks, two of which are optional.
      1. Add an ActionListener for the Quit button, according to the TODO item in GameMain.
      2. Add a MouseListener for the game runner according to another TODO item in GameMain. Your mouse listener should be fairly simple. Just get the location of a mouse click and call the appropriate GameRunner method.
      3. Bonus: Create a new Game implementation for the Game of Nim. You should create a new class that implements Game. Write code for all the required methods, studying TicTacToe as an example. Change the value of the constant THE_GAME in GameMain to use your new class. This should be the only change you need to make to the existing code for your new game to work.
      4. Double Bonus: Create a new Game implementation for Dots and Boxes, following the recommendations from the previous item.

Remember, in all your code:

Here is the grading rubric for this assignment.

Turn-in Instructions

Turn in your programming work by committing it to your SVN repository.