0% found this document useful (0 votes)
20 views4 pages

#Include #Include Usingnamespace Int Int Double

This C++ program uses switch statements to calculate phone bills or weekly pay for different options. For phone bills, it calculates the cost based on the number of calls and pricing plan selected. For weekly pay, it outputs the set pay for managers or calculates pay for hourly, commission, or pieceworkers based on hours, commission percentage, or items/pay rate provided. The program demonstrates using switch statements to perform different calculations based on user input.

Uploaded by

Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

#Include #Include Usingnamespace Int Int Double

This C++ program uses switch statements to calculate phone bills or weekly pay for different options. For phone bills, it calculates the cost based on the number of calls and pricing plan selected. For weekly pay, it outputs the set pay for managers or calculates pay for hourly, commission, or pieceworkers based on hours, commission percentage, or items/pay rate provided. The program demonstrates using switch statements to perform different calculations based on user input.

Uploaded by

Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

#include<iostream>

#include<conio.h>
usingnamespace std;
int main()
{
int calls, phonebill, option;
double v, s, t, m;
cout <<"Enter calls"<< endl;
cin >> calls;
cout <<"Enter Option"<< endl;
cin >> option;
switch (option)
{
case 1:
if (calls <= 100)
cout <<"Phonebill is Rs.100"<< endl;
break;
case 2:
if (calls <= 150)
v = 200 + (0.6 * 50);
cout <<"Phonebill is Rs. "<< v << endl;
break;
case 3:
if (calls <= 200)
s = 200 + (0.6 * 50) + (0.5 * 50);
cout <<"Phonebill is Rs."<< s << endl;
break;
case 4:
if (calls > 200)
cout <<"Enter extra calls"<< endl;
cin >> m;
t = 200 + (0.6 * 50) + (0.5 * 50) + (0.4*m);
cout <<"Phonebill is Rs."<< t << endl;
break;
default:
cout <<"Wrong information provided"<< endl;
}
_getch();
return 0;
}
#include<iostream>
#include<conio.h>
usingnamespace std;
int main()
{
float code1 = 500, code2;
float code3, code4;
int option, s, v;
cout <<"Input option"<< endl;
cin >> option;
switch (option)
{
case 1:
cout <<"The weekly pay of each of Managers is $"<< code1 << endl;
break;
case 2:
code2 = (1 * 40) + (1.5 * 8);
cout <<"The weekly pay of each of Hourly employes is $"<<code2<< endl;
break;
case 3:
code3 = 250 + 14.25;
cout <<"The wekly pay of each of Comission workers is $"<<code3<< endl;
break;
case 4:
cout <<"Enter amount per itom"<< endl;
cin >> s;
cout <<"Enter itom per week"<< endl;
cin >> v;
code4 = s*v;
cout <<"The weekly pay of each of pieceworkers is $"<< code4 << endl;
break;
default:
cout <<"Incorrect informtion "<< endl;
break;
}
_getch();
return 0;
}

You might also like