java类

木其工作室 qq 928900200
 You are to write a program that uses a class that you have created called Person.  Your program will demonstrate that your class is working properly by testing each and every required method.  In order to do that your program will need to prompt the user to enter at least three individual’s information.  Your program will use the individual object to test your Person class.

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.

You are to modify your person class from the last assignment to deal with having date of birth (DOB) instead of age as part of the input. This modification should include any methods necessary to process the DOB so that the individual DOB can be output in MM/DD/YYYY format and also your personal class should be able to still provide a person age in years.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值