Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in java. The class Employee stores the name, employee id and salary per day for each employee. The program will display the employee name,

Write in java. The class Employee stores the name, employee id and salary per day for each employee. The program will display the employee name, id and the final salary.

The Employee class should consist of the following

1 - 'calSal()' which takes the salary, number of hours of work per day of employee as parameter 2 - 'AddSal()' which adds $10 to the salary of the employee if it is less than $50. 3 - 'AddWork()' which takes number of hours work per day and adds $5 to the salary of employee if the number of hours of work per day is more than 6 hours.

4 displayInfo() which returns the name , employees id and the final salary.

Create a parameterized constructor with a mutator method to assign the values to the attributes. The mutator can only be accessed by the class. Design the class accordingly based on the tasks of the methods above. Create the accessor methods.

Your TASK

Part 1

Write the Employee class Employee . Save the file as Employee.java.

Part 2

Create a client class ClientEmployee and save as ClientEmployee.java.

In the client class, do the following: -

You are required to declare 2 Employees. Get the input for name. staff id and salary. Display the information for each employee.

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago