The person class is to have the following attributes:
First name
Last name
Street address
City
State
Zip code
age
Your person class is to also provide methods to allow the following operations:
Access the person’s name in the following format <First Name> <Last Name> for example John Smith
Access the person’s first name
Access the person’s last name
Access the person’s age
Access the components that make up a person’s address
Allow the person’s last name to be changed
Allow any of the components that make up a person’s address to be changed
Your class should provide two constructors one which will receive all the necessary information and one that does not receive any outside information You are also to implement the toString and equals methods:
The toString method when used should provide results in the following format:
<First Name> <Last Name> age <age>
<street address>
<City>, <State> <zip code>
For example:
John Smith age 21
1313 Mocking Bird Lane
Cincinnati, OH 45221
For the purposes of the equals method equality is defined as the first and last name of two objects being identical.
The data file provided has an unknown number of entries ( but you can assume no more than 100 while there could be less) which you are to read in and sort by last name and where two last names are the same by first name. When you have sorted the information you are to output into a file with the following format:
Dewey Cheatem and Howe
Law Offices
Client List
Adams, John
1776 Liberty Ave
Boston, MA 02011
Age: 279
Dover, Ben
1200 Flex Ave.
Cincinnati, OH 45221
Age: 18
.
.
.
You assignment will be tested with a file which has the following format:
FIRST NAME LAST NAME STREET ADDRESS CITY STATE ZIP DATE OF BIRTH(MM DD YY)
i.e.
John Adams 1776 Liberty Ave Boston MA 02011 10 30 1735