Assignment 4

CSIS 10B
Assignment 4 Generics and Container Classes
Due: next Wed
In Class Demo (0 points):
1) GenericDemo
a. Error susceptibility of Vector class
b. Converting Association to a generic class
c. Converting Vector to a generic class
d. More experiments with Associations, Vector of Associations
e. Switch Statements and Database operations
2) TestVector
a. Make a simple sort method for a vector of String
b. Using java.util.Vector vs java.util.ArrayList class
Assignment (10 points) Do either Basic or Advanced.
Use java.util.Vector class to continue developing the database operations from the lecture
demonstration to be able to load the entire Student100.txt file into a vector of associations of attributes
(firstName, lastName, ID, GPA). Then present a menu of choices to allow the user to
1)
2)
3)
4)
5)
6)
insert a new student’s record into the vector database
fetch and display a student record from the vector by entering only the ID
fetch and display a student record by first and last names
update a student record into the vector database
delete a student record from the database
output all the student information sorted by lastName, firstName order
Advanced: Othello
If you would like a more difficult challenge, try the game discussed at the following website:
http://www.cs.grinnell.edu/~rebelsky/Courses/CS152/97F/Assignments/assignment.04.html
Begin by thinking about how you might write Othello (or an interesting variant thereof) using Bailey’s
Matrix class. As a minimum, consider defining two classes: GameBoard and Piece and the methods
they will support. You can import structure5.Matrix to access the Matrix class.