Objective: To get experience using abstract classes and interfaces.
Due: Before class on Friday.
To start, you can either:
assign6 directory ORbin/ before the location of your
image files/home/courses/cs209/handouts/assign6. To
edit the code in Eclipse, you'll need to copy the files somewhere
under your home directory.Now for the refactoring of your code:
@Override annotation on the move
methods of your child classes, you should add that. If you get
errors, fix the errors (most likely caused by not using the
appropriate parameters).GamePiece class so that it is
an abstract class with an abstract
move method.Game class's animate method
to have an array of GamePiece objects, which contains
the GamePiece objects that you just created. Iterate
through the objects, calling the move method on each
object. (If you're getting errors, you likely didn't override
the move method correctly.) You can look at my base
code
in /home/courses/cs209/handouts/assign6/Game.java to
help guide you.
GamePiece, discuss why
making GamePiece abstract is a better approach to
organizing/designing the codeGame,
move method on
a GamePiece object--a method that is abstract--and the
application does the "right" thing Modify your Assignment 5 classes excluding
the Driver program to belong to a package. Name the package
edu.wlu.cs.yourusername Use Eclipse to make the package
and move your classes into the
package. Move is part of
the Refactor menu.
Modify your driver program to import the classes from the package. (Eclipse may have done that for you already.)
Modify your Assignment 5 MediaItem classes
to implement the Comparable interface.
In your driver program, sort and display the elements in the array.
Save your output in a file.
Copy your project into an assign6 directory
in your turnin directory.
You will be evaluated based on the following criteria: