// Menu driven program with arrays of food and prices #include #include using namespace std; void printAll(string food[], double price[], int count); //prints menu void instructions(); //display choices void process(char answer, string food[], double price[], int count); //call correct function void main() { string food[8]={"hotdog","fries","soda","cookie","pizza","burger", "taco","shake"}; double price[8]={1.75,1.50,0.90,1.25,3.00,3.50,2.00,1.75}; int count=8; char answer; instructions(); cin>>answer; while ((answer != 'q') && (answer != 'Q')) { process(answer,food,price,count); instructions(); cin>>answer; } //loop until they enter a Q } //main void instructions() //display choices { cout<<"C++ Fast Food\n"; cout<<"Enter M to print the menu\n"; cout<<"Enter Q to quit\n"; cout<<"Your choice:"; } //instructions void process(char answer, string food[], double price[], int count) //call correct function //call correct function { switch (answer) { case 'M': case 'm': printAll(food, price, count); break; case 'Q': case 'q': break; //don't go to default default: cout<<"Invalid choice\n"; } //switch } //process void printAll(string food[], double price[], int count) { cout<<"Item\tFood\tPrice\n"; cout.precision(2); cout.setf(ios::fixed); for (int i=0; i