Answered step by step
Verified Expert Solution
Question
1 Approved Answer
/ / 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started