-- Introduction to Computer Science II
Exercises: [no exercises this week.]
Programming Projects: 1. [Bonus] You should
re-implement the Vector ADT introduced in Chapter 6 using the
LinkedList ADT. That is, instead of an array as the underline
data container, use a linked list. You should not need to modify
the LinkedList at all. You will be writing a single file,
Vector.java, that will contain the new implementation of the ADT.
This will naturally use the LinkedList type and make calls to its
methods. For your own verification, you will want to create a
test class that creates and manipulates your new Vector type.
Note, this test class should work equally well with the author's Vector
type as your linked-list Vector type.
2. Extend the Asteroids game
program from the text. (1) Change the world so that asteroids and
rockets can wrap around from top to bottom and side to side. (2)
Alter your Station class so that it can move up and down and left and
right. You do not need to get fancy with drawing the Station --
the existing line is sufficient. However, your new station should
also wrap just like the asteroids and rockets will after step 1.
(3) When asteroids are reduced to zero size, remove them from the
list of asteroids. (4) After a rocket has hit an asteroid or has
moved for 25 time steps, remove it from the list of rockets.
On your machine where you are doing your homework, create a folder
called <your email name> followed by "A6". For example,
with email address "cjones" would create a folder called
Inside that folder, place plain text file(s) containing your answers to
any exercises. Also, place whatever Java files are necessary
your Programming Projects in the same folder. Finally, either tar
zip the folder so that when I
it, the folder
"<emailname>A6" will be created. (Note: the '<'
and '>' should not be part
of your folder name.) If
you choose to use zip instead of tar, change the extension of the
resulting zip file
from "<something>.zip" to "<something>.foo". This
webmail will allow you to attach the file. If I get an attachment
extension .foo, I will change it back to .zip and all should be well.