Input:
name of employee, position in the company, no. of hours worked, no. of overtime hours, rate per hour.
Formula:
Basic pay= no. of hours worked x rate per hour
OT pay= overtime hours x 150% of rate per hour
Gross pay = basic pay + OT pay
total ded= tax+sss+med
1
Expert's answer
2014-10-06T10:34:38-0400
#include <iostream> using namespace std; //main method int main() { //variable for name Employee char nameEmployee[15]; //variable for position In Company int positionInCompany; //variable for no HoursWorked int noHoursWorked; //variable for noOvertimeHours int noOvertimeHours; //variable for ratePerHour double ratePerHour; double BasicPay,pay,GrossPay,TotalDed; //name of employee, position in the company, no. of hours worked, no. of overtime hours, rate per hour. //promt user to enter name Employee cout<<"Enter name of employee: "; //read name Employee cin>>nameEmployee; //enter position in the company cout<<"Enter position in the company: "; //read position in the company cin>>positionInCompany; cout<<"Enter no. of hours worked: "; //read no. of hours worked cin>>noHoursWorked; cout<<"Enter no. of overtime hours: "; //read no. of hours worked cin>>noOvertimeHours; cout<<"Enter rate per hour: "; //read no. of hours worked cin>>ratePerHour;
//Basic pay= no. of hours worked x rate per hour BasicPay=noHoursWorked*ratePerHour; //pay= overtime hours x 150% of rate per hour pay=noOvertimeHours*150*ratePerHour/100; //Gross pay = basic pay + OT pay GrossPay=BasicPay+pay; //total ded= tax+sss+med TotalDed=BasicPay+pay+GrossPay; //show result cout<<"Basic pay = $"<<BasicPay<<"\n"; cout<<"Pay = $"<<pay<<"\n"; cout<<"Gross pay = $"<<GrossPay<<"\n"; cout<<"Total Ded = $"<<TotalDed<<"\n"; //delay system("pause"); //exit program return 0; }
Comments
Leave a comment