Question: / / This program determines a client's total buffet luncheon cost / / when the number of guests and the per person cost are known.
This program determines a client's total buffet luncheon cost
when the number of guests and the per person cost are known.
It contains a logic error.
#include
#include
using namespace std;
int main
const int ADULTMEALCOST ; Child meal cost of this
int numAdults, Guests ages and older
numChildren; Guests ages
double adultMealTotal, Total for all adult meals
childMealTotal, Total for all child meals
totalMealCost;
Get number of adults and children attending
cout "This program calculates total cost
"for a buffet luncheon.
;
cout "Enter the number of adult guests age and over: ;
cin numAdults;
cout "Enter the number of child guests age : ;
cin numChildren;
Calculate meal costs
adultMealTotal numAdults ADULTMEALCOST;
childMealTotal numChildren ADULTMEALCOST ;
totalMealCost adultMealTotal childMealTotal;
Display total meal cost
cout fixed showpoint setprecision;
cout
Total buffet cost is $ totalMealCost endl;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
