Question: I am trying to solve this problem that has been answered. I followed the instructions and I am unable to compile. My code: #include #include

 I am trying to solve this problem that has been answered.

I am trying to solve this problem that has been answered. I followed the instructions and I am unable to compile. My code:

#include

#include

#include

using namespace std;

struct menuItemType;

{

double menuitem[10];

double menuprice[10];

}

void getData(menuItemType &m,int &c);

void showMenu();

void printcheck (menuItemType &m, int c);

void main()

{

menuItemType menulist;

int c;

showMenu();

getData(menulist,c);

printcheck(menulist,c);

system("pause");

}

void showMenu()

{

cout

cout

cout

cout

cout

cout

cout

cout

cout

}

void getData(menuItemType &m,int &c)

{

int k;

int choice;

cout

cin>>c;

cout

for (k=0;k

{

cin>>choice;

switch(choice)

{

case 1:m.menuitem[k]="Plain Egg";

m.menuprice[k]= 1.45;

break;

case 2:m.menuitem[k]="Bacon & Egg";

m.menuprice[k]= 2.45;

break;

case 3:m.menuitem[k]="Muffin";

m.menuprice[k]= 0.99;

break;

case 4:m.menuitem[k]="French Toast";

m.menuprice[k]= 1.99;

break;

case 5:m.menuitem[k]="Fruit Basket";

m.menuprice[k]= 2.49;

break;

case 6:m.menuitem[k]="Cereal";

m.menuprice[k]= 0.69;

break;

case 7:m.menuitem[k]="Coffee";

m.menuprice[k]= 0.50;

break;

case 8:m.menuitem[k]="Tea";

m.menuprice[k]= 0.75;

break;

}

}

}

void printcheck(menuItemType &m,int c);

{

int j;

float price=0.0, tax=0.0,total;

cout

for(j=0;j

{

cout

price=price+m.menuprice[j];

}

tax=0.05*price;

total=tax+price;

std::cout

std::cout

cout

cout

}

Please provide a working code as well as explanation as to the errors.

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 Bacon and Egg Muffin French Toast Fruit Basket Cereal Coffee Tea $1.45 $2.45 $0.99 $1.99 $2.49 $0.69 $0.50 $0.75 Use an array, menuList, of the struct menuItemType, as defined i Programming Exercise 3. Your program must contain at least th following functions: Function getData: This function loads the data into the array menuList Function showMenu: This function shows the different item offered by the restaurant and tells the user how to select the items, Function printCheck: This function calculates and prints the check (Note that the billing amount should include a 5% tax.) A sample output is: ielcome to Johnny's Restaurant Bacon and Egg $2.45 Muffin Coffee Tax Amount Due $0.99 $0.50 $0.20 $4.14 Format your output with two decimal places. The name of each item in the output must be left justified. You may assume that the user selects only one item of a particular type

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!