Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement a class called Employee. An employee has a name and gets a salary. Every pay period each employee gets an additional amount in
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. CAN C:\PROGRA-1XINOXS-11JCREAT-11GE 200... 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.... X
Step by Step Solution
★★★★★
3.52 Rating (166 Votes )
There are 3 Steps involved in it
Step: 1
Java code to create Employee class Employeejava public class Employee attributes private String name private double salary private double bonus 2arg c...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