Malik A.

asked • 07/22/21

I have no idea what I am doing wrong??

in this program, I spouse to let the user chose many items from the menu, but I don't know how to let stops from looping, also I don't know how I will collect the total?? could someone help me?


here is the doctor example and result



https://mrkzgulfup.com/uploads/162697891793371.png

https://mrkzgulfup.com/uploads/162697891796842.png


and here are my codes



#include <iostream>

#include <string>

#include <iomanip>

#include <cmath>


using namespace std;


double Item_Pick();


int main()

{

double payemant;

int numItem, choise{};

int item, loop = {}, cont;

cont = 0;

choise = 0;


double Item_Pick();

item = Item_Pick();


while (choise != 8)

{

cout << "\nEnter your choice from the menu below:";

cout << "\n1) Gyro $7.00";

cout << "\n2) Moussaka $8.50";

cout << "\n3) Salad $3.75";

cout << "\n4) Dolma $2.00";

cout << "\n5) Soda $2.80";

cout << "\n6) Coffee $1.00";

cout << "\n7) Water $2.00";

cout << "\n8) End of Order";

cout << "\nEnter your menu choice>";

cin >> item;


cont++;


}







cout << endl << endl;

system("pause");

return 0;

}

double Item_Pick()

{

int choice{}, numItem;

string itemName;

double itemPrice, tax, tip;

const double TAX_RATE = .065;

const double TIP_RATE = .20;


switch (choice)

{

case 1:

itemName = "Gyro";

itemPrice = 7;

break;


case 2:

itemName = "Moussaka";

itemPrice = 8.50;

break;


case 3:

itemName = "Salad";

itemPrice = 3.75;

break;


case 4:

itemName = "Dolma";

itemPrice = 2;

break;


case 5:

itemName = "Soda";

itemPrice = 2.80;

break;


case 6:

itemName = "Coffee";

itemPrice = 1;

break;


case 7:

itemName = "Water";

itemPrice = 2;

break;


}

return choice;



}

1 Expert Answer

By:

Patrick B. answered • 07/22/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Malik A.

I am studying CIS 1111, we didn't take all that you did
Report

07/23/21

Patrick B.

there ya go...
Report

07/23/21

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.