#4. Write a program to help a local restaurant automate its breakfast billing sy
ID: 3567312 • Letter: #
Question
#4. Write a program to help a local restaurant automate its breakfast billing
system. The program should do the following:
a. Show the customer the different breakfast items offered by the restaurant.
b. Allow the customer to select more than one item from the menu.
c. Calculate and print the bill.
Assume that the restaurant offers the following breakfast items (the price
of each item is shown to the right of the item):
Plain Egg $1.45
Bacon and Egg $2.45
Muffin $0.99
French Toast $1.99
Fruit Basket $2.49
Cereal $0.69
Coffee $0.50
Tea $0.75
Your program must contain at least the
following functions:
Explanation / Answer
#include #include #include #include using namespace::std; struct menuItemType { char menuItem[20]; double menuPrice; }; void getData(menuItemType menuList[8]); void showMenu(menuItemType menuList[8], menuItemType orderList[], int orderCounter, int selection); void printCheck(menuItemType menuList[8], int orderCounter, const double TAX); const int MAX = 8; const double TAX = 1.05; menuItemType menuList[8]; menuItemType orderList[MAX]; int main() { int orderCounter = 0; int selection = ' '; getData(menuList); showMenu(menuList, orderList, orderCounter, selection); printCheck(orderList, orderCounter, TAX); return 0; } void getData(menuItemType menuList[8]) { strcpy(menuList[0].menuItem,"Plain Egg"); menuList[0].menuPrice = 1.45; strcpy(menuList[1].menuItem,"Bacon and Egg"); menuList[1].menuPrice = 2.45; strcpy(menuList[2].menuItem,"Muffin"); menuList[2].menuPrice = 0.99; strcpy(menuList[3].menuItem,"French Toast"); menuList[3].menuPrice = 1.99; strcpy(menuList[4].menuItem,"Fruit Basket"); menuList[4].menuPrice = 2.49; strcpy(menuList[5].menuItem,"Cereal"); menuList[5].menuPrice = 0.69; strcpy(menuList[6].menuItem,"Coffee"); menuList[6].menuPrice = 0.50; strcpy(menuList[7].menuItem,"Tea"); menuList[7].menuPrice = 0.75; } void showMenu(menuItemType menuList[8], menuItemType orderList[], int orderCounter, int selection) { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.