ICS 22
Homework 5
Due 11/2
- Reminder: we check for cheating (via copying) and all students involved with get a grade of zero for this homework.
- Rolodex. Write a Java program that allows the user to manage a list of business cards (similar to a Rolodex). Each card has a name, phone number, and address. Each name has a first name, middle name, and last name. Each phone number has an 3 digit area code, a 3 digit prefix, and a 4 digit suffix, e.g., (949)555-1212. Each address has a number, a street name, a city, and a 5 digit zip code. The Rolodex always displays the 'current card.' If the Rolodex is empty, the current card should be blank. The Rolodex should allow the following operations:
- reset, current card is set to the first card which is displayed
- insert a new card, info is taken from the input card, current card is set to the new card just inserted
- lookup a specified last name, name is taken from a text field, current card is set to the found card which is displayed,
- forward, moves to and displays the next card in the Rolodex, forwards from the last card should take you back to the first card.
- backward, moves backward to and displays the previous card in the Rolodex, backwards from the first card should take you to the last card.
- delete, deletes the current card, current card advances to the next card.
- GUI design. The GUI should have one panel to display one card used both to display the current card and for the user to enter information for a new card as described above. There should be a text field that allows one to enter the last name of a person for lookup. You should have a button for each operation described above. The button's label should be the obvious one-word command given above, e.g., reset, insert, lookup, forward, backward, delete.
- Program Design. You should define separate Java classes for Card, Name, PhoneNumber, and Address. Define a class Rolodex that is a list of Cards (not Objects). Define operations that you need to write the complete program.
- The GUI is 50 points and the Rolodex and its associated classes
are 50 points.