Question: Problem Specification Create a ( simplified ) contact book! Write a java program to add contact information to a contact record and display the contact
Problem Specification
Create a simplified contact book! Write a java program to add contact information to a contact record and display the contact details!
In this challenge, create domain classes called Contact and Address and one driver class called ContactBook. For each domain class, write the constructor, toString method, and getterssetters for each attribute.
The Address class will contain the following private attributes:
Street number int
Street name String
Zip Code int
City String
State String
The Contact class will contain the following private attributes:
First name String
Last name String
Birthday String with format of mmddyyyy
Phone number String
Email address String
Home address Address
Write a driver class called ContactBook that has the following methods
createAddressRecord
Asks the user via the console for the street name, street number, zip code, city, and state of an address and instantiates an Address object with that information. Returns the newly constructed Address object.
createContactRecordAddress homeAddress
Asks the user via the console for the first name, last name, birthday, phone number, and email address of a contact and instantiates a Contact object with that information. Returns the newly constructed Contact object.
showContactDetailsContact contact
Prints the message Here is the contact info for and concatenates contacts first & last names. Then prints the contact object information. Remember that toString method is not called explicitly.
main
Calls createAddressRecord method which will return an Address object
Calls createContactRecord method which will return a Contact object
Repeats steps & to create different contact objects.
Calls showContactDetails method times once for each Contact object
Example Output
Contact Book!
Add new address:
Enter the street number:
Enter the street name: Hillwood Street
Enter the ZIP code:
Enter the city: Seattle
Enter the state: WA
Add new contact:
Enter the first name: Arnold
Enter the last name: Shortman
Enter the birthday mmddyyyy:
Enter the phone number:
Enter the email address: footballhead@heyarnold.com
Contact Saved!
Add new address:
Enter the street number:
Enter the street name: Dimmsdale Drive
Enter the ZIP code:
Enter the city: Dimmsdale
Enter the state: CA
Add new contact:
Enter the first name: Timmy
Enter the last name: Turner
Enter the birthday mmddyyyy:
Enter the phone number:
Enter the email address: timmy.turner@fairlyoddparents.com
Contact Saved!
Add new address:
Enter the street number:
Enter the street name: Middleton Way
Enter the ZIP code:
Enter the city: Middleton
Enter the state: CA
Add new contact:
Enter the first name: Kim
Enter the last name: Possible
Enter the birthday mmddyyyy:
Enter the phone number:
Enter the email address: call.mebeep.me@kimpossible.com
Contact Saved!
Here are the contact details for Arnold Shortman:
Contactfirstname: 'Arnold', lastname: 'Shortman', birthday: phoneNumber: email: 'footballhead@heyarnold.com', homeAddress: Addressnumber: street: 'Hillwood Street', city: 'Seattle', state: WA zipCode:
Here are the contact details for Timmy Turner:
Contactfirstname: 'Timmy', lastname: 'Turner', birthday: phoneNumber: email: 'timmy.turner@fairlyoddparents.com', homeAddress: Address number: street: 'Dimmsdale Drive', city: 'Dimmsdale', state: CA zipCode:
Here are the contact details for Kim Possible:
Contactfirstname: 'Kim', lastname: 'Possible', birthday: phoneNumber: email: 'call.mebeep.me@kimpossible.com', homeAddress: Addressnumber: street: 'Middleton Way', city: 'Middleton', state: CA zipCode:
Submission
You need to submit a single file named ContactBookjava
Grading Criteria
Code readability:
Using comments to explain logic:
Correctness of Java syntax no compilation error:
Proper scan of System.in:
Proper usage of methods:
Proper indirect use of toString:
Program displays all required messages when given valid input:
Program displays numeric values to specification:
Passing all tests:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
