Write a java program using classes and object to read the em[loyee code (Integer), Imployee name (string), Basic salary )double), Category (Character)then calculate the bonus(double)and the total salary(double)eligible for each employ. The output should have the employee code, employee name, basic salary, grade bonus and the total salary. The program must use switch-case construct for calculations. Test your program for 5 employees.

If the employee belong to
Grade A bonus=20% basic
Grade B bonus=15% basic
Grade C bonus=10% basic
Grade D bonus=7% basic
Grade E bonus=5% basic

Sample Output:
Employee code :1234
Employee Name :aaaa
Basic Salary :1000 $
Grade :A/B/C/D/E
Bonus :1111$
Total Salary : Basic salary + Bonus

1 answer

suggested approach:
create a class for each Employee, with class properties as
integer code
string name
double salary
char category
double bonus
double totalSalary

with class methods called
double calculateBonus()
void printEmployee()

Use switch-case to calculate bonus.
Add bonus and salary to get totalSalary. Bonus is usually a percentage (see table given) of salary.