Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To write a program in Java that implements the following Advanced Programming concepts: 1. Data encapsulation 2. Instantiate classes 3. Inheritance 4. Graphical User Interface

To write a program in Java that implements the following Advanced Programming concepts:

1. Data encapsulation

2. Instantiate classes

3. Inheritance

4. Graphical User Interface concepts

Assignment #7: Add Employee

Section 7.1 The program will have a class called Employee, the following private attributes:

1. ID

2. Social security number (ssn)

3. salutation (Mr., Mrs, Ms.)

4. first name

5. last name

6. maiden name

7. earning type (1 salaried, 2 hourly)

8. earning (hour pay)

Section 7.2 Using the above class make the following frame class (EmployeeFrame):

image text in transcribed

When the user filled the Hour Pay field after losing focus you must calculate Week payment and Year payment. Week payment and Year payment fields should be disable.

The Add button will instantiate class Employee populating all attributes with the text of the components of your GUI then print all the fields into the console using method toString() of the Employee class, like:

Employee:

id=1234,

salutation=Darth,

firstName=Vader,

lastName=Skywaker,

maidenName=Unknown,

ssn=123-10-2045,

earning_type=1,

earnings=30.0

The Cancel button will close the frame.

Section 6.3 Earning Types:

Your GUI will have two types of earnings, when you select:

Hourly the GUI will show all the components shows in section 6.2.

Salaried the GUI will change label Hour Pay: to Salary:, and will hide the rest of the components.

Your project will have at least 3 classes:

Employee class with attributes of section 7.1.

EmployeeFrame class with the GUI of section 7.2.

EmployeeDriver class who call EmployeeFrame.

Your program should implement any exception handling that been required.

Add Employee ID: 1234 Blue panel Salutation: Darth SSN: First Name: Vader Last Name: S Mothers Last Name: Unknown 123-10-2045 employee photo er Hour Pay: Week Pavment: Year Payment 30.00- earning $1,200.00(earning x 40.0hrs) $62,400.00 (week earning x 52 weeks) employee earning type O Salaried O Hourly Add Cancel Figure 1. Add Employee Frame

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions