I am trying to setup a function for the following code and am having a problem. I need to show a $25.00 security fee for groups of 20 or more people who buy tickets. I have the "if, else" portion down I think but need a function to to the work.
if (child + youth + adult >= 20){ // in event theres20 or more poeple
cout <<" Total Bill: " <<" $" <<CostChild + CostYouth + CostAdult + 25<<"***" <<endl <<endl;
}
else { // otherwise
cout <<" Total Bill: " <<" $" <<CostChild + CostYouth + CostAdult <<endl <<endl;
}
cout <<" *One person is free for every 4 tickets in this age group\n";
cout <<" **The price is $9 per adult in excess of 10 adults\n";
if (child + youth + adult >= 20){ // Gota let em know about the fee
cout<<" ***A $25 security fee has been attached as you have 20 or more people\n";
}
cin >> any;
return 0;
Any assistance/suggestions is greatly appreciated!
Code:
if (child + youth + adult >= 20){ // Gota let em know about the fee