Question
i need this to be done by netbeans Problem-Solving Tips: 1. Class Employee should declare three instance variables (private). firstName (String), lastName (String), monthlySalary (double)
i need this to be done by netbeans
Problem-Solving Tips: 1. Class Employee should declare three instance variables (private). firstName (String), lastName (String), monthlySalary (double)
2. Declare public set and get method for each instance variable. The set methods should not return values and should each specify a parameter of a type that matches the corresponding instance variable (String for first name and last name, double for the salary). The get methods should receive no parameters and should specify a return type that matches the corresponding instance variable. setFirstName, setLastName, setMonthlySalary getFirstName, getLastName, getMonthlySalary
3. Declare a public get method that will return a double value and calculate net salary of the employee. Net salary means, the salary that an employee receive after deducting 10% tax. So this method will return net salary which is (salary * 0.90)). getNetSalary
4. Class EmployeeTest should create object or instance of Employee class Employee em1 = new Employee();
5. Ask the user to enter first name, last name, and salary. Call the set methods of em1 and set the values. Note: Make sure you dont accept salary less than 1000
6. Display the output by calling get methods of em1. Display First name (em1.getFirstName()) Display Last name (em1.getLastName()) Display Salary (em1.getSalary()) Display Net Salary (em1.getNetSalary())
7. Create another object or instance of Employee class say em2 and repeat step 5 and 6 with em2.
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