Question: 1. Create a class TelephoneNumber 1. Variables (10%) 1. areaCode - three digit int 2. exchangeCode 3 digit int 3. Number - four digit int
1. Create a class TelephoneNumber 1. Variables (10\%) 1. areaCode - three digit int 2. exchangeCode 3 digit int 3. Number - four digit int 2. Methods 1. TelephoneNumber(aString (15\%) 1. A constructor that creates and returns a now instance o its class given a string in the form xock-xox--o000 or 000x000 : 2. Throw an exception if the format is not valid 2. tostring - returns a string in cither of the two formats shown preiouvlsy based on if it has an area code or not. (10\%) 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 (15\%) 5. Allow the user to add or delete 1 number (10\%) 6. Write the modieifed data back into the text file replacing the original contents (208) 7. Then read/display the file. (2003)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
