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 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
#include <iostream>
using namespace std;
double amount;
double studendOrPensioner(int&choice, double &origPrice);
double OtherCustomers(int&choice,double& origPrice);
int main()
{
int customertype;
cout<<"s. Student\n";
cout<<"S. Student\n";
cout<<"p. Pensioner\n";
cout<<"P. Pensioner\n";
cout<<"O. Other customers: ";
cin>> customertype;
switch ( customertype ) {
case 's':
case 'S':
case 'p': // Note the colon, not a semicolon
case 'P':
cout << "You have selected pensioner or student" << endl;
double studendOrPensioner(int&choice, double &origPrice);
break;
case 'o':
case 'O': // Note the colon, not a semicolon
cout<<"You have selected other customers ";
double OtherCustomers(int&choice,double& origPrice);
break;
}
cin.get();
}
double studendOrPensioner(int&choice,double& origPrice)
{
cout << "You have selected a student or a pensioner ";
cout << "Enter choice ";
cout << "100 for ticket only";
cout << "200 for ticket and popcorn";
cin >> choice;
if (choice == 100){
cout << "Please enter the original price: ";
cin >> origPrice;
return origPrice - (origPrice * 20 / 100);
} else
{
#include <iostream>
using namespace std;
double amount;
double studendOrPensioner(int&choice, double &origPrice);
double OtherCustomers(int&choice,double& origPrice);
int main()
{
int customertype;
cout<<"s. Student\n";
cout<<"S. Student\n";
cout<<"p. Pensioner\n";
cout<<"P. Pensioner\n";
cout<<"O. Other customers: ";
cin>> customertype;
switch ( customertype ) {
case 's':
case 'S':
case 'p':
case 'P':
cout << "You have selected pensioner or student" << endl;
double studendOrPensioner(int&choice, double &origPrice);
break;
case 'o':
case 'O':
cout<<"You have selected other customers ";
double OtherCustomers(int&choice,double& origPrice);
break;
}
cin.get();
}
double studendOrPensioner(int&choice,double& origPrice)
{
cout << "You have selected a student or a pensioner ";
cout << "Enter choice ";
cout << "100 for ticket only";
cout << "200 for ticket and popcorn";
cin >> choice;
if (choice == 100){
cout << "Please enter the original price: ";
cin >> origPrice;
return origPrice - (origPrice * 20 / 100);
} else
{
double OtherCustomers(int&choice,double& origPrice)
{cout << "You have selected a student or a pensioner ";
cout << "Enter choice ";
cout << "100 for ticket only";
cout << "200 for ticket and popcorn";
cin >> choice;
if (choice == 100){
cout << "Please enter the original price: ";
cin >> origPrice;
return origPrice - (origPrice * 20 / 100);
}
else {
origPrice;}
}
}
}
|