You are on page 1of 2

# Dietel and Dietel Exercise Solution 2.

56
============================================
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int op;
cout<<"Enter 1 to calculate weekly manager "<<endl;
cout<<"Enter 2 to calculate hourly worker"<<endl;
cout<<"Enter 3 to calculate commission worker "<<endl;
cout<<"Enter 4 to calculate piece worker "<<endl;
cin>>op;
switch(op)
{
case 1:
{
int salary,paycode;
cout<<"Enter the week of paycode ";
cin>>paycode;
cout<<"Enter the weekly rate of manager in Rupees
";
cin>>salary;
cout<<"The weekly amount of the manager is
"<<paycode*salary<<endl;
break;
}
case 2:
{
int hour,salary ;
cout<<"Enter the hour of worker ";
cin>>hour;
cout<<"Enter the hourly rate of worker in Rupees ";
cin>>salary;
if(hour<=40)
cout<<"The hourly amount of the manager is
"<<hour*salary<<endl;
else
{
int temp=hour*40;
temp=((hour-40)/2)*salary+temp;
cout<<"The hourly amount of the manager is
"<<temp<<endl;
}
break;
}
case 3:
{
int sold,week;
cout<<"Enter the week of worker ";
cin>>week;
cout<<"Enter the items sold by worker in week ";
cin>>sold;
double temp1 =(250*sold)*0.057;
cout<<"The weekly amount of the comissioner is
"<<week*temp1<<endl;
break;
}
case 4:
{
int create ,month;
cout<<"Enter the items produce ";
cin>>create;
cout<<"Enter the month rate the produce work in
Rupees ";
cin>>month;
cout<<"The weekly amount of the manager is
"<<create*month<<endl;
break;

}
getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006