Question: Create a class TelephoneNumber Variables areaCode - three digit int exchangeCode - 3 digit int Number - four digit int Methods TelephoneNumber(aString) A constructor that

Create a class TelephoneNumber Variables areaCode - three digit int exchangeCode -Create a class TelephoneNumber Variables areaCode - three digit int exchangeCode - 3 digit int Number - four digit int Methods TelephoneNumber(aString) A constructor that creates and returns a new instance o its class given a string in the form xxx-xxx-xxxx or xxx-xxxx. Throw an exception if the format is not valid toString - returns a string in either of the two formats shown preiouvlsy based on if it has an area code or not. Create a file with several telephone numbers varying between the 2 formats Write a program that reads the file displays the data on the screen and creates an array whose base type is telephone number Allow the user to add or delete 1 number Write the modieifed data back into the text file replacing the original contents Then read/display the file.

Java program preferred!!!!

Create a class TelephoneNumber 1. Variables 1. areaCode - three digit int 2. exchangeCode 3 digit int 3. Number - four digit int 2. Methods 1. TelephoneNumber(aString) 1. A constructor that creates and returns a new instance o its class given a string in the form xxxxx xxx or x xx-xxxx. 2. Throw an exception if the format is not valid 2. toString - returns a string in either of the two formats shown preiouvlsy based on if it has an area code or not. 3. Create a file with several telephone numbers varying between the 2 formats 4. Write a program that reads the file displays the data on the screen and creates an array whose base type is telephone number 5. Allow the user to add or delete 1 number 6. Write the modieifed data back into the text file replacing the original contents 7. Then read/display the file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!