Consider a class PersonAddress that represents an entry in an address book. Its attributes are
• The first name of the person
• The last name of the person
• The e-mail address of the person (how can me make sure this is an e-mail address)?
• The telephone number of the person (how can me make sure this is a properly formatted phone number?)
It will have methods to
• Access each attribute
• Change the e-mail address
• Change the telephone number
• Test whether two instances are equal based solely on name
a. Write a method heading for each method.
b. Write preconditions and postconditions for each method.
c. Write some Java statements that test the PersonAddress class. You must call this class PersonAddressTest.
d. Draw a class diagram.
e. Implement the class.
Last Updated on February 11, 2019 by EssayPro