Question: Write a program in c + + that computes buffet meal pricing. The price is based on the following factors: Day of the week Weekend
Write a program in c that computes buffet meal pricing. The price is based on the following factors:
Day of the week
Weekend buffet is more expensive than weekdays
Time of entry. The buffet is only open from :am to :pm
Breakfast opens at :am $
Lunch starts at :am $
Dinner starts at :pm $
Type of customer
Adult Regular price
Child Half price
Senior off
The input will consist of:
The day of the week. AI should ignore the char restriction and use std::string
Read as one of the following pairs of character values, which are stored in two variables of type char
Valid designation are Mo Tu We Th Fr Sa Su
Be sure to allow the user to use either uppercase or lowercase or a combination of the two. eg Mo and mO should both work!
The time the customer arrived
Input in hour notation, so the time : pm is input as :
It will be read as one int then a single char then another int. AI should ignore this restriction
The type of customer as a single character stored as type char.
Note Be sure to prompt the user for all inputs. Check for errors and handle them appropriately!
The output will be all the entered details of the customer visit followed by the calculated cost of the meal.
Your program should:
Have a function to display information about the program. Some kind of introduction
Have a functions to get valid input from the user. Some kind of getDay getTime getCustomerType functions
Have a function or functions to calculate the cost of the meal something like calculateCost
Have a function to nicely display all the details of the bill including the cost. something like showDetails
Include a loop that lets the user repeat this process until the user says she or he is done.
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
