Create a C++ payroll calculation program to process payroll information for a si
ID: 3668787 • Letter: C
Question
Create a C++ payroll calculation program to process payroll information for a single employee.
Create a C++ payroll calculation program to process payroll information for a single employee. Submit this assignment as a single .cpp file attachment: other files will not be accepted. The program must calculate and display the following items: INPUT: User will enter the values in yellow for the data items below. Use the cin statement to accept the input data. When an employee works more than 40 hours, regularPay is payRate times 40 hours overtimePay is 1.5 times payRate times (hoursWorked minus 40.0) grossPay is regularPay plus overtimePay When an employee works 40 hours or less, regularPay is payRate times hoursWorked overtimePay is 0 (zero) grossPay is regularPay Use the information in the following table to determine unionDues: netPay is grossPay minus unionDues. Display following information:Explanation / Answer
#include <iostream.h>
#include<conio.h>
int main()
{
int empId,unionCode;
double hoursWorked,payRate;
double regularPay,overtimePay,grossPay,unionDues,netPay;
cout<<"Please enter your employee ID:";
cin>>empID;
cout<<"enter number of hours you worked:";
cin>>hoursWorked;
cout<<"enter your pay rate";
cin>>payRate;
cout<<"enter your union code number";
cin>>UnionCode;
if(hoursWorked >40)
{
regularPay = payRate*40.0;
overtimePay = 1.5*payRate*(hoursWorked-40.0);
grossPay= regularPay+ overtimePay;
}
else if(hoursWorked <=40)
{
regularPay=payRate*hoursWorked;
overtimePay= 0.0;
grossPay= regularPay;
}
if(unionCode == 1)
{
unionDues= 15.00;
}
else if(unionCode ==2)
{
unionDues= 25.00;
}
else if(unionCode==3)
{
unionDues =35.00;
}
netPay= grossPay- unionDues;
cout<<"the details of employee ID"<<empID;
cout<<"hours worked="<<hoursWorked;
cout<<"pay Rate="<<payRate;
cout<<"union Code="<<unionCode;
cout<<"RegularPay ="<<regularPay<<"$";
cout<<"over-time pay="<<overtimePAy<<"$";
cout<<"gross Pay="<<grossPay<<"$";
cout<<"union Dues that you need to pay is="<<unionDues<<"$";
cout<<"Your net Pay is:"<<netPay<<"$";
return 0;
}
Note: you can use swich cases instead of using if repeatedly..