#include #include using namespace std; struct menuitem { int idnum; char name[20
ID: 3653730 • Letter: #
Question
#include #include using namespace std; struct menuitem { int idnum; char name[20]; float price; int qty; }; void displaymenu(menuitem); void printcheck(menuitem); menuitem things[8] = {{1,"Plain Egg",1.45,0}, {2,"Bacon & Egg",2.45,0}, {3,"Muffin",0.99,0}, {4,"French Toast",1.99,0}, {5,"Fruit basket",2.49,0}, {6,"Cereal",0.69,0}, {7,"Coffee",0.50,0}, {8,"Tea",0.75,0}}; int choice; int main () { cout << " Welcome to resturaunt Awesome Sauce. Where all our sauce is boss." <<endl <<endl <<endl; cout << "To display the menu please press enter"; displaymenu(things[8]); cout << "To make an item choice please input the id number one at a time and press enter:"; cout << "If you would like to exit total your purchase please enter 9 qnd press enter:"; cin >> choice; while (choice!= 9) { if (choice >10) { cout << "Please try again"; } else if (choice > 0) { things[choice].qty++; } } if (choice = 9) { printcheck(things[8]); } return 0; } void displaymenu ( menuitem things[]) { cout << "Our menu consists of:" <<endl <<endl; for (int i=0; i<8; i++) { cout <<things[i].name <<" $" <<things[i].price <<" ID number:" <<things[i].idnum <<endl; } } void printcheck ( menuitem things[]) { float total; float tax; for (int i=0; i<8; i++) { if (things[i].qty > 0) { total =+ things[i].qty *things[i].price; cout << things[i].name <<": " << things[i].price << " "<< things[i].qty <<" "<<(things[i].qty*things[i].price) <<endl; } } tax = total * .0775; cout << "Tax: " <<tax; cout << "Amount due is:" <<(total + tax); } I have issues, and I am unable to figure out what. Any help would be appreciatedExplanation / Answer
See comments #include using namespace std; struct menuitem { int idnum; char name[20]; float price; int qty; }; void displaymenu( struct menuitem []); //error was in this line void printcheck(struct menuitem []); //error was in this line struct menuitem things[8] = {{1,"Plain Egg",1.45,0}, {2,"Bacon & Egg",2.45,0}, {3,"Muffin",0.99,0}, {4,"French Toast",1.99,0}, {5,"Fruit basket",2.49,0}, {6,"Cereal",0.69,0}, {7,"Coffee",0.50,0}, {8,"Tea",0.75,0}}; int choice; int main () { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.