Objective: To get experience using abstract classes and interfaces.
Due: Before class on Friday.
Start a new project in Eclipse but say that you're using existing source code and give the path to your Assignment 4 code (the game).
Modify the GamePiece
class so that it is
an abstract
class with an abstract
method move
.
Test your new code.
In comments in GamePiece
, discuss why this is a
better approach to organizing the code.
equals
Method in Birthday
Class
(20)In assignment 3, you implemented a Birthday class and
its equals
method. At the time, we did not know all the
techniques to implement the equals
method properly.
Copy the Birthday class into this assignment's directory and modify
your equals
method to execute the following procedure,
which should be followed for all equals
methods you
implement in the future:
instanceof
operator to check if the
argument has the correct type. (Note: if a variable is a null
reference, then instanceof
will be
false
, so we don't need to check if the other object is
null separately.)Double.compare
and for floats
use Float.compare
Modify your Assignment 5 classes excluding the Driver
program to belong to a package. Use Eclipse to make the
packages and move your classes into the package. Move
is part of the Refactor
menu. Name the package
edu.wlu.cs.yourusername
Modify your driver program to import the classes from the package.
Modify your Assignment 5 MediaItem
classes
to implement
the Comparable
interface.
In your driver program, sort the elements in the array.
Copy your code into an assign6
directory
in your turnin
directory.
You will be evaluated based on the following criteria: