Question: Reforming the code to be four functions for computing performanceBonus, totalSala 1 y , taxDeduction, netSalary respectively. The main function is used as an interface
Reforming the code to be four functions for computing performanceBonus, totalSalay taxDeduction, netSalary respectively. The main function is used as an interface for entering employee information and displaying the results. Marks
public class EmployeeSalary
public static void mainString args Scanner scanner new ScannerSystemin; double CL TAMA; ;c System.out.printEnter the basic pay: ; double basicPay scanner.nextDouble;
System.out.printEnter the performance rating Excellent Very Good, Good, Satisfactory: ; String performanceRating scanner.next;
System.out.printEnter the number of years of experience: ; int yearsOfExperience scanner.nextlnt;
double performanceBonus ; switch performanceRating
case "Excellent":performanceBonus basicPay ;break; case "Very Good": performanceBonus basicPay ;break; case "Good":performanceBonus basicPay ;break; default: break;
if basicPay
ifbasicPay CL basicPay ;
if basicPay CL;
else CL;
if basicPay TA basicPay; ;
else TA;
if basicPay MA basicPay ; else MA ;
double totalSalary basicPay performanceBonus CL TA MA;
double taxDeduction;
iftotalSalary taxDeduction totalSalary ; else taxDeduction totalSalary;
double totalSalary ;
double netSalary totalSalary taxDeduction P ; System.out.printlnTotal Salary: $ totalSalary; System.out.printlnTax Deduction: $ taxDeduction; System.out.printlnNet Salary: $ netSalary;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
