Question
In java format please implement a class called Employee. An employee has a name and gets a salary. Every pay period each employee gets an
In java format please
implement a class called Employee. An employee has a name and gets a salary. Every pay period each employee gets an additional amount in bonus. In your solution, include a constructor that accepts the name and salary of an employee. Provide a mutator method that accepts the bonus amount and adds it to the salary. Provide necessary accessor methods to return the name, the salary before the bonus was applied, the bonus, and the salary after the bonus has been applied. Write a test class called TestEmployee to produce output similar to the one below.
AS CREA ABC Payroll Employee Employee name : John Brown Salary before bonus : $45000.0 Bonus amount : $1000.0 Salary after bonus : $46000.0 Employee Employee name : Mary Jane Salary before bonus: $65000.0 Bonus amount : $800.0 Salary after bonus : $65800.0 Report End--- Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started