On This Page
Overview
In this assignment, you create an address book. During this assignment, you will:
- Create multiple classes and objects
- Save objects in an array
^ top
Operation
Welcome to the Address Book application
1 - Add entry
2 - List entries
3 - Exit
Your choice: 1
Enter name: Bill Gates
Enter street address: 1835 73rd Ave NE
Enter city: Medina
Enter state: WA
Enter zip code: 98039
1 - Add entry
2 - List entries
3 - Exit
Your choice: 1
Enter name: Ed Parrish
Enter street address: 123 Parrish Place
Enter city: Santa Cruz
Enter state: CA
Enter zip code: 95060
1 - Add entry
2 - List entries
3 - Exit
Your choice: 2
1: Bill Gates 1835 73rd Ave NE Medina, WA 98039
2: Ed Parrish 123 Parrish Place Santa Cruz, CA 95060
1 - Add entry
2 - List entries
3 - Exit
Your choice: 3
Goodbye!
- If the first menu item is selected, the user enters name, street, city, state, and zip code.
- If the second menu item is selected, the application displays a list of all the entries.
- If the third menu item is selected, the application exits.
^ top
Specifications
Create a class named Address that contains the following instance variables:
private String street;
private String city;
private String state;
private String zip;
This class must contain a constructor that accepts values to initialize these variables and get methods that return each one. In addition, it must contain a method named toString() that returns a String with the information stored in the Address object.
- Create a class named
AddressBookEntry that contains the following instance variables:
private String name;
private Address address;
- Code at least two constructors in the
AddressBookEntry class: one that accepts a name and Address object and one that accepts a name, city, street, state, and zip code. A programmer that uses this class should be able to set the address by either sending in an Address object or the string variables for street, city, state, and zip.
- Code
set and get methods for each of the instance variables of the AddressBookEntry class.
- Code a method named
toString() that returns a String with the information stored in the AddressBookEntry object.
- Code a driver class named
AddressApp that has the menus which control the application. AddressApp creates address book entries, saves them in an array and displays the entries as shown in the Operation section.
- You may assume that valid data is entered.
- Do not use package statements at this time.
^ top
Extra Credit
The following are worth extra credit points:
- Create a class named
Validator that contains static methods that can be used to validate the user input in this application. (2 points depending)
- Create a test class named
AddressAppTest that uses static methods to test the methods of all the classes of this application. (1 to 3 points depending on the completeness of the tests)
Make certain that your README.txt file lists any extra credit attempted.
^ top
Grading Criteria
The instructor will evaluate your assignment using the following criteria. Each criteria represents a specific achievement of your assignment and has a scoring guide. The scoring guide explains the possible scores you can receive.
Some scoring guides have a list of indicators. These indicators are a sign of meeting, or a symptom of not meeting, the specific criterion. Note that a single indicator may not always be reliable or appropriate in a given context. However, as a group, they show the condition of meeting the criterion.
For information on grading policies, including interpretation of scores, see the course information page.
Program Compilation
- 4: Source code compiles with no errors or warnings
- 2: Source code compiles with warnings
- 0: Does not compile
Functionality
- 10: Demonstrates mastery of the assignment
- Has extra features or demonstrates techniques beyond the assignment
- Applies concepts from the lessons appropriately
- Meets all specifications (see above) with particularly elegant solutions
- Runs to completion with no abnormal error conditions
- Generates correct output given correct input
- Behaves in a reasonable way in response to incorrect data
- All test cases pass
- 8: Has all the functionality expected of the assignment
- Demonstrates many techniques from the lesson
- Meets all specifications (see above)
- Implementation seems more complicated than necessary.
- May have one minor error
- All test cases pass
- 6: Has most of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets all but one of the specifications (see above)
- Implementation seems excessively complicated.
- May have 2-3 minor errors
- All but one test case passes
- 4: Has some of the functionality expected of the assignment
- Demonstrates some techniques from the lesson
- Meets at least 1/2 of the specifications (see above)
- Implementation seems excessively complicated.
- May have more than 3 minor errors
- At least 1/2 of all test cases pass
- 2: Serious functional problems but shows some effort and understanding
- Meets less than 1/2 of the of the specifications (see above)
- Has a major error or many minor errors
- Implementation seems very convoluted
- Demonstrates few techniques from the lesson
- Less than 1/2 of all test cases pass
- 0: Does not execute
Program Style
- 4: Code is well-documented
- 3: Code has minor documentation errors
- Has 1 documentation error
- 2: Code has some documentation errors
- Has 2-3 documentation errors
- 1: Code has many documentation errors
- Has more than 3 documentation errors
- 0: No apparent attempt to document code
README.txt File
- 2: README.txt file submitted with specified information included
- 1: README.txt submitted but some information was not included
- 0: No README.txt submitted
Maximum Score: 20, plus extra credit
^ top
What to Turn In
Submit your assignment following the instructions for homework. Include the following items for grading:
README.txt file
Address.java
AddressBookEntry.java
AddressApp.java
- Any other source code needed to make your program function
You must submit all the files needed to make your assignment function properly. Do not assume that the instructors has any files unless explicitly stated by the instructor. Your assignment must work as submitted.
^ top
Home
| WebCT
| Announcements
| Schedule
| Room Policies
| Course Info
Help
| FAQ's
| HowTo's
| Links
Last Updated: April 01 2005 @16:37:30
|