#include<iostream>
#include<conio.h>
#include<iomanip>
using namespace std;
int main ()
{
int paycode,weklysalary,hourlysalary,totalhours,grossweklysales,pieces,piecewage;
double pay;
cout<<"Enter paycode (1 to 4):"<<endl;
cout<<"press 1 for manager weelky salary"<<endl;
cout<<"press 2 for hourly worker salary"<<endl;
cout<<"press 3 for comission worker salary"<<endl;
cout<<"press 4 for piece worker salary"<<endl;
cin>>paycode;
switch (paycode)
{
case 1:
{
cout<<"Manager selected." << endl;
cout<<"Enter weekly salary: ";
cin>>weklysalary;
cout<<endl;
pay=weklysalary;
cout<<"The manager's pay is " << pay;
cout<<endl;
}
break;
case 2:
{
cout<<"Hourly worker selected." << endl;
cout<<"Enter the hourly salary: ";
cin>>hourlysalary;
cout<<endl;
cout<<"Enter the total hours worked: " << endl;
cin>>totalhours;
if ( totalhours <= 40)
pay = hourlysalary * totalhours;
else
pay = (40.0 * hourlysalary) + (totalhours - 40) * (hourlysalary * 1.5);
cout<<endl;
cout<<"Worker's pay is " << pay;
cout<<endl;
}
break;
case 3:
{
cout<<"Commission worker selected." << endl;
cout<<"Enter gross weekly sales: ";
cin>>grossweklysales;
cout<<endl;
pay = (grossweklysales *.57) + 250;
cout<<" Commission worker's pay is " << pay;
}
break;
case 4:
{
cout<<"Pieceworker selected." << endl;
cout<<"Enter number of pieces: ";
cin>>pieces;
cout<<"Enter wage per piece: ";
cin>>piecewage;
pay = pieces * piecewage;
cout<<"Pieceworker's pay is " << pay;
}
break;
default:
cout<<"invalid number";
}
return 0;
}