Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

#include#include#include using namespace std; struct menuItemType { string menui

ID: 3657677 • Letter: #

Question

#include#include#include using namespace std; struct menuItemType { string menuitem[10]; double menuprice[10]; }; void showmenu(); void getdata(menuItemType &m, int &c); void printcheck(menuItemType &m, int c); int main() { menuItemType menulist; int c; showmenu(); getdata(menulist, c); printcheck(menulist, c); system("pause"); return 0; } void showmenu() { cout <<"Welcome to Johnny's Restaurant"<<endl; cout <<"--------Today's Menu--------"<<endl; cout <<"1: Plain Egg $1.45"<<endl; cout <<"2: Bacon and Egg $2.45"<<endl; cout <<"3: Muffin $0.99"<<endl; cout <<"4: French Toast $1.99"<<endl; cout <<"5: Fruit Basket $2.49"<<endl; cout <<"6: Cereal $0.69"<<endl; cout <<"7: Coffee $0.50"<<endl; cout <<"8: Tea $0.75"<<endl<<endl; } void getdata(menuItemType &m, int &c) { int k; int choice; char selection; cout <<"You can make up to 8 single order selections"<<endl; cout <<"Do you want to make a selection Y/y(Yes), N/n(No):"; cin >> selection; if(selection == 'y'||selection == 'Y') { for(k=0;selection!='n';k++){ cout<<"Enter item number: "; cin >> choice; cout<<"Select another item Y/y(Yes), N/n(No): "; cin >>selection; switch(choice) { case 1: m.menuitem[k]="Plain Egg"; m.menuprice[k]=1.45; break; case 2: m.menuitem[k]="Bacon and Egg"; m.menuprice[k]=2.45; break; case 3: m.menuitem[k]="Muffin"; m.menuprice[k]=.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]=.69; break; case 7: m.menuitem[k]="Coffee"; m.menuprice[k]=.50; break; case 8: m.menuitem[k]="Tea"; m.menuprice[k]=.75; break; } }} else if (selection=='N'||selection=='n') cout<<"OK. Good bye."<<endl; else cout<<"Invalid selection"<<endl; } void printcheck(menuItemType &m, int c) { int j; float price=0.0, tax=0.0, total; cout <<"Welcome to Johnny's Restaurant"<<endl; for(j=0;j<< m.menuitem[j]<<" "<<m.menuprice[j]<<endl; price=price+m.menuprice[j]; } tax=.05*price; total=tax+price; cout<<setprecision(2); cout<<"Tax "<<tax<<endl; cout<<"Amount Due "<<total<<endl; }

Explanation / Answer

please format the code and paste its in unreadable way try using komodo edit