Question: *In Java I want you to use Inheritance and Composition in this program. You DO NOT have to include Exception Handling. Your assignment is to

*In Java

I want you to use Inheritance and Composition in this program. You DO NOT have to include Exception Handling.

Your assignment is to design an online address book that contains the functionality described below. I want you to be able to process 10 entries and implement a menu system to perform the required program operations, this will be created in the ADT AddressBook, but the classes Address, Date, Person, ExtPerson should be created first.

("Welcome to the address book program.");

("Choose among the following options:");

("1: To see if a person is in the address book");

("2: Print the information of a person");

("3: Print the names of person having birthday in a particular month");

("4: Print the names of persons having a particular status");

("5: Print the address book");

("9: Terminate the program");

I want you to make ALL of the data members in each class PRIVATE. I will specifically be looking for your use of constructors to initialize the data members. Remember that the keyword super must be used to call a base class constructors and/or methods from a derived class.

In addition to the implementing class (which will create an object of type AddressBook), you will be creating the following classes.

Address -street number, city, state, zip

ExtPerson (derived from Person AND is composite)- char status, Address address

Person-String name, int age, Date date of birth

Date-month, day, year

AddressBook (composite class)-main method, array of Person

Testing:

Make sure you are testing every method you wrote.

Deliverables:

1.Your source code from ALL the classes you create and/or use. I also want a UML diagram for EVERY class (which can be used to design your solution).

2.Screen prints of your test scenarios. 3.Include comments

ex of class Address

public class Address {

private int streetNumber;

private String city;

private String state;

private int zip;

/**

*no arg constructor

*/

Address(){

}

/**

* @param streetnumber

* @param city

* @param state

* @param zip

*/

Address(int streetnumber, String city, String state, int zip) {

this.setStreetNumber(streetnumber);

this.setCity(city);

this.setState(state);

this.setZip(zip);

}

/**

*

* @return the streetNumber

*/

public int getStreetNumber() {

return streetNumber;

}

/**

* @param streetNumber the streetNumber to set

*/

public void setStreetNumber(int streetNumber) {

this.streetNumber = streetNumber;

}

/**

* @return the city

*/

public String getCity() {

return city;

}

/**

* @param city the city to set

*/

public void setCity(String city) {

this.city = city;

}

/**

* @return the state

*/

public String getState() {

return state;

}

/**

* @param state the state to set

*/

public void setState(String state) {

this.state = state;

}

/**

* @return the zip

*/

public int getZip() {

return zip;

}

/**

* @param zip the zip to set

*/

public void setZip(int zip) {

this.zip = zip;

}

/* (non-Javadoc)

* @see java.lang.Object#toString()

*/

@Override

public String toString() {

return "Address [streetNumber=" + streetNumber + ", city=" + city + ", state=" + state + ", zip=" + zip + "]";

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!