Question: Java : Write a program to enter Employee data, including social security number and salary, into an array. (The maximum number of employees is 100,
Java :
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 called SSNLengthException for when the social security number entered (SSN) is not exactly nine characters and SSNCharacterException for when any character in the social security number is not a digit. (The SSN is to be entered with just the numbers and no dashes or spaces.) When an exception is thrown, the user is 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 will output the records for all employees, with an annotation stating whether the employees salary is above or below average. You will also need to define the classes Employee, SSNLengthException, and SSNCharacterException. The class Employee will be a derived class of the class Person available on the K: drive. Among other things, the class Employee should have input and output methods, as well as constructors, accessor methods, and mutator methods. Every employee object will record the employees name, salary, and social security number (plus any other data you need or think are appropriate). PrintScreen your results.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
