Question: Write a class ContactInfo to store contact information for a person. It should have attributes for a persons name, business phone, home phone, cell phone,
Write a class ContactInfo to store contact information for a person. It should have attributes for a person’s name, business phone, home phone, cell phone, e-mail address, and home address. It should have a toString method that returns this data as a string, making appropriate replacements for any attributes that do not have values. It should have a constructor ContactInfo(aString) that creates and returns a new instance of the class, using data in the string aString. The constructor should use a format consistent with what the toString method produces.
Using a text editor, create a text file of contact information, as described in the previous paragraph, for several people. Write a program that reads this file, displays the data on the screen, and creates an array whose base type is ContactInfo. Allow the user to do one of the following: change some data in one contact, add a contact, or delete a contact. Finally, write over the file with the modified contacts.
Step by Step Solution
3.37 Rating (147 Votes )
There are 3 Steps involved in it
public class InvalidContactException extends Exception Creates a new instance of InvalidContactException public InvalidContactExceptionString reason superreason public class ContactInfo private String ... View full answer
Get step-by-step solutions from verified subject matter experts
