Using OOP in java Create a class called Employee that includes three pieces of information as instance variables—a first name (typeString), a last name (typeString) and a monthly salary (double).Provide a set and a get method for each instance variable.Keep in mind you should get values from user.There should be a method called calculateSalary() witch deducts the income tax from the salary on the following basis: 20% income tax if the salary is above Rs 30000. 15% income tax if the salary is between Rs.20000 and Rs.30000. 10% income tax if the salary is below Rs. 20000. Write a test application named EmployeeTest that demonstrates class Employee’s capabilities. Create Employee objects and display each object’s full name ,salary , income tax and net salary of employees.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Using OOP in java
Create a class called Employee that includes three pieces of information as instance variables—a first name (typeString), a last name (typeString) and a monthly salary (double).Provide a set and a get method for each instance variable.Keep in mind you should get values from user.There should be a method called calculateSalary() witch deducts the income tax from the salary on the following basis:
20% income tax if the salary is above Rs 30000.
15% income tax if the salary is between Rs.20000 and Rs.30000.
10% income tax if the salary is below Rs. 20000.
Write a test application named EmployeeTest that demonstrates class Employee’s capabilities. Create Employee objects and display each object’s full name ,salary , income tax and net salary of employees.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps