Write a program to enter employee data, including social security number and salary, into an array. The maximum number of employees is 100, but your program should also work for any number of employees less than 100. Your program should use two exception classes, one called SSNLengthException for when the social security number entered—without dashes or spaces—is not exactly nine characters and the other called SSNCharacterException for when any character in the social security number is not a digit. When an exception is thrown, the user should be reminded of what she or he entered, told why it is inappropriate, and asked to reenter the data. After all data has been entered, your program should display the records for all employees, with an annotation stating whether the employee’s salary

It may be useful to review arrays of objects before doing this project. For example, even after creating the array of EmployeeCh8 objects, it is necessary to create each element with a new statement inside the loop that reads in the employee’s information. Note that it is useful to use the same variable for the array subscript and the employee’s number, except that the subscript begins with 0 and the employee number begins with 1. So, whenever the employee number needs to be displayed, simply use the expression (subscript variable + 1).


See the code in EmployeeCh9.java, EmployeeCh9Demo.java, SSNLengthException.java, and SSNCharacterException.java. Uses Person.java.

Computer Science & Information Technology

You might also like to view...

What is bottom-up testing?

What will be an ideal response?

Computer Science & Information Technology

____________________ effects are typically used to draw attention to bullets as they appear on the slide during a presentation.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Which of the following is not a sampling option for the Clone Stamp and the Healing Brush tools?

A. Current & Below B. Layer Side C. Current Layer D. All Layers

Computer Science & Information Technology

On the ribbon, on the Data tab, use commands in the ________ group to bring data from outside Excel into an Excel worksheet

A) Connections B) Data Tools C) Analysis D) Get External Data

Computer Science & Information Technology