Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that models an employee. An employee has an employee number, a name, an address, and a hire date. A name consists of

Write a program that models an employee. An employee has an employee number, a name, an address, and a hire date. A name consists of a first name and a last name. An address consists of a street, a city, a state (2 characters), and a 5-digit zip code. A date consists of an integer month, day and year. All fields are required to be non-blank. The Date fields should be reasonably valid values (ex. month 1-12, day 1-31, year > 1900 and < 2020). Issue appropriate error messages when incorrect data is entered.

Create an Employee, a Name, an Address, and a Date classes in your solution. You may use the Date class from the lectures or define your own. The Java-supplied Date class cannot be used. Provide appropriate class constructors, getter methods, setter methods, toString() and any other methods you think are necessary. To keep things simple, your classes dont need to do any editing of data. The classes should not do any direct user input/output. All user input/output will be done in the main method.

Your program should prompt the user to enter data for several employees,store the data in an array of type Employee, and then display the data. Be sure to comment your code and use the course code formatting style.

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_2

Step: 3

blur-text-image_3

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions

Question

Briefly explain Adam Smith's four canons of taxation.

Answered: 1 week ago