1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
#include "other.h"
#include <iostream>
using namespace std;
class GrossPay
{
double Hours, Hwage;
public:
void set_values (double,double);
double Gross() {return Hours*Hwage*52;}
};
void GrossPay::set_values (double x, double y)
{
Hours = x;
Hwage = y;
}
class OvertimePay
{
double Overhours,Overwage;
public:
void set_values (double,double);
double Overpay() {return Overhours*Overwage*52;}
};
void OvertimePay::set_values (double w, double z)
{
Overhours = w;
Overwage = z;
}
void UserSelect()
{
char a[7]={'A','n','d','r','e','w','\0'},b[4]={'B','o','b','\0'},c[7]={'C','a','r','l','o','s','\0'},d[6]={'D','a','n','n','y','\0'},e[7]={'E','d','w','a','r','d','\0'};
char f[8]={'F','r','a','n','c','i','s','\0'},g[6]={'G','r','a','c','e','\0'},h[6]={'H','e','n','r','y','\0'},i[7]={'I','n','f','r','i','d','\0'},j[6]={'j','a','c','o','b','\0'};
double value1=0,value2=0;
double temp1=0,temp2=0;
short select1=0;
cout<<"Please select the worker from the list below:\n1.-Andrew.\n2.-Bob.\n3.-Carlos.\n4.-Danny.\n5.-Edward.\n6.-Francis.\n7.-Grace.\n8.-Henry.\n9.-Infrid.\n10.-Jacob."<<endl;
cin>>select1;
switch(select1)
{
case 1:
cout<<"Working with "<<a<<endl;
break;
case 2:
cout<<"working with "<<b<<endl;
break;
case 3:
cout<<"working with "<<c<<endl;
break;
case 4:
cout<<"working with "<<d<<endl;
break;
case 5:
cout<<"working with "<<e<<endl;
break;
case 6:
cout<<"working with "<<f<<endl;
break;
case 7:
cout<<"working with "<<g<<endl;
break;
case 8:
cout<<"working with "<<h<<endl;
break;
case 9:
cout<<"working with "<<i<<endl;
break;
case 10:
cout<<"working with "<<j<<endl;
break;
}
cout<<"please enter the hours worked during the week.\n";
cin>>value1;
cout<<"Please enter the hourly wage in U.S. dollars.\n";
cin>>value2;
if (value1 > 40)
{
temp1=value1-40;
temp2=value2*1.5;
value1=40;
}
}
|