Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Problem Write a program to enter employee data, including Social Security number and salary, into an array. The maximum number of employees is 100

Java Problem

image text in transcribed

image text in transcribed

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 SSN LengthException for when the Social Security number entered-with- out 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. Afler all data has been entered, your progranm should display the records for all employees, with an annotation statin;g whether the employee's salary is above or below average. You will also need to define the classes Employee, SSNLengthException, and SSNCharac- tcrExccption . Dcrive thc class Employcc from thc class Person in Listing 8.1 of Chapter 8. Among other things, the class Employee should have input and output methods, as well as constructors, accessor methods, and muta- tor methods. Every Employee object should record the employee's name (as defined in Person), salary, and Social Security number, as well as any other data you need or think is appropriate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Performance Indexing In SQL Server

Authors: Jason Strate, Grant Fritchey

2nd Edition

1484211189, 9781484211182

More Books

Students also viewed these Databases questions

Question

8. Describe characteristics and advantages of mediation.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago