#include #include #include using namespace std; struct menuItemType { string menuItem; double menuPrice; }; void getData(menuItemType menuList[]); void showMenu(menuItemType menuList[] , int n); void printCheck(menuItemType menuList[], int menu_order[], int n); int main() { const int item = 8; menuItemType menuList[item]; int menu_order[item] ={0}; int choice =0; int count =0; bool order = true; getData(menuList); showMenu(menuList,item); while(order) { cout<<"Enter the choice for the order or press 0 to exit"<>choice; if(choice>0 && choice<=item) { menu_order[choice-1]+=1; } else { order=false; } } printCheck(menuList,menu_order,item); return 0; } void getData(menuItemType menuList[]) { menuItemType plainEgg; menuItemType baconEgg; menuItemType muffin; menuItemType frenchToast; menuItemType fruitBasket; menuItemType cereal; menuItemType coffee; menuItemType tea; plainEgg.menuItem = "Plain Egg"; plainEgg.menuPrice = 1.45; baconEgg.menuItem = "Bacon and Egg"; baconEgg.menuPrice = 2.45; muffin.menuItem = "Muffin"; muffin.menuPrice= 0.99; frenchToast.menuItem = "French Toast"; frenchToast.menuPrice = 1.99; fruitBasket.menuItem = "Fruit Basket"; fruitBasket.menuPrice = 2.49; cereal.menuItem = "Cereal"; cereal.menuPrice = 0.69; coffee.menuItem ="Coffee"; coffee.menuPrice = 0.50; tea.menuItem = "Tea"; tea.menuPrice = 0.75; menuList[0] = plainEgg; menuList[1] = baconEgg; menuList[2] = muffin; menuList[3] = frenchToast; menuList[4] = fruitBasket; menuList[5] = cereal; menuList[6] = coffee; menuList[7] = tea; } void showMenu(menuItemType menuList[], int n) { int count; cout<<"Restaurant Breakfast Menu"<0) { cout<

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

struct menuItemType
{
string menuItem;
double menuPrice;
};

void getData(menuItemType menuList[]);
void showMenu(menuItemType menuList[] , int n);
void printCheck(menuItemType menuList[], int menu_order[], int n);

int main()
{
const int item = 8;
menuItemType menuList[item];
int menu_order[item] ={0};
int choice =0;
int count =0;
bool order = true;
getData(menuList);
showMenu(menuList,item);
while(order)
{
cout<<"Enter the choice for the order or press 0 to exit"<<endl;
cin>>choice;
if(choice>0 && choice<=item)
{
menu_order[choice-1]+=1;
}
else
{
order=false;
}
}
printCheck(menuList,menu_order,item);
return 0;
}

void getData(menuItemType menuList[])
{
menuItemType plainEgg;
menuItemType baconEgg;
menuItemType muffin;
menuItemType frenchToast;
menuItemType fruitBasket;
menuItemType cereal;
menuItemType coffee;
menuItemType tea;
plainEgg.menuItem = "Plain Egg";
plainEgg.menuPrice = 1.45;
baconEgg.menuItem = "Bacon and Egg";
baconEgg.menuPrice = 2.45;
muffin.menuItem = "Muffin";
muffin.menuPrice= 0.99;
frenchToast.menuItem = "French Toast";
frenchToast.menuPrice = 1.99;
fruitBasket.menuItem = "Fruit Basket";
fruitBasket.menuPrice = 2.49;
cereal.menuItem = "Cereal";
cereal.menuPrice = 0.69;
coffee.menuItem ="Coffee";
coffee.menuPrice = 0.50;
tea.menuItem = "Tea";
tea.menuPrice = 0.75;
menuList[0] = plainEgg;
menuList[1] = baconEgg;
menuList[2] = muffin;
menuList[3] = frenchToast;
menuList[4] = fruitBasket;
menuList[5] = cereal;
menuList[6] = coffee;
menuList[7] = tea;
}

void showMenu(menuItemType menuList[], int n)
{
int count;
cout<<"Restaurant Breakfast Menu"<<endl;
cout<<endl;
for(count=0; count<n;count++)
{
cout<<setw(2)<<left<<count+1<<setw(20)<<left
<<menuList[count].menuItem<<'$'<<menuList[count].menuPrice<<
endl;
}
}

void printCheck(menuItemType menuList[], int menu_Order[], int n)
{
double Bill = 0;
double calculated_Tax =0;
const double Tax = .05;
cout<<"Welcome to Johnny's Restaurant"<<endl;
for(int i=0;i<n;i++)
{
if(menu_Order[i]>0)
{
cout<<fixed<<setprecision(2)<<setw(20)<<left<<
menuList[i].menuItem<<'$'<<(menuList[i].menuPrice*menu_Order[i])
<<endl;
Bill+=(menuList[i].menuPrice*menu_Order[i]);
}
}
calculated_Tax = Bill* Tax;
Bill+= calculated_Tax;
cout<<setw(20)<<left<<"Tax"<<'$'<<fixed<<setprecision(2)
<<calculated_Tax<<endl
<<setw(20)<<left<<"Amount Due"<<"$"<<Bill<<endl;
}

 

Redo the C++ code above so that the output is what the picture shows. 

 

Welcome to Johnny's Restaurant
1 Bacon and Egg
$2.45
$1.98
$0.50
$0.25
$5.18
2 Muffin
1 Coffee
Таx
Amount Due
Transcribed Image Text:Welcome to Johnny's Restaurant 1 Bacon and Egg $2.45 $1.98 $0.50 $0.25 $5.18 2 Muffin 1 Coffee Таx Amount Due
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Operations of vector class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education