I am supposed to write a food menu program for this one summer class an i have been trying for the past 2 hours to figure it out.
Directions:
Write a program which allows the user to choose a beverage, sandwich and side order from a menu. After the choices are made, the program should do the following:
•list the items chosen with the cost of each item
•the sub-total of just the items
•the total cost including tax (use 6.5% for the tax).
The following are the items and prices you must include:
Beverages:
1: Soda: $0.99
2: Milk: $0.79
3: Juice: $1.29
Sandwiches:
1: Hamburger: $0.99
2: Cheeseburger: $1.09
3: Chicken Sandwich: $2.59
Side Orders:
1: French Fries: $0.89
2: Onion Rings: $1.09
3: Corn Chips: $0.59
The output should look something like this (you have some freedom to decide on your output, but it must include the items and prices, the sub-total, the tax, and the total cost including tax)
Soda: $0.99
Hamburger: $0.99
French Fries: $0.89
Total of food: $2.87
Tax: $0.19
Total for order: $3.06
Here is the code I have:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int drink;
int sandwich;
int side;
int dcost;
int swcost;
int socost;
cout << "This program lists the drink, side order," << endl;
cout << "and sandwich choices along with the prices" << endl;
cout << "of each. After they are all picked it" << endl;
cout << "calculates the subtotal and then the" << endl;
cout << "total including tax." << endl;
cout << "\n" << endl;
cout << "List of Drinks" << endl;
cout << "1. Soda: $0.99" << endl;
cout << "2. Milk: $0.79" << endl;
cout << "3. Juice: $1.29" << endl;
cout << "Please type 1, 2 or 3 here: " << endl;
cin >> drink;
if (drink == 1)
dcost == "$0.99";
if (drink == 2)
dcost == "$0.79";
if (drink == 3)
dcost == "$1.29";
cout << "\n" << endl;
cout << "List of Sandwiches" << endl;
cout << "1. Hamburger: $0.99" << endl;
cout << "2. Cheeseburger: $1.09" << endl;
cout << "3. Chicken Sandwich: $2.59" << endl;
cout << "Please type hamburger, cheeseburger or chicken here: " << endl;
cin >> sandwich;
if (sandwich == 1)
swcost == "$0.99";
if (sandwich == 2)
swcost == "$0.79";
if (sandwich == 3)
swcost == "$2.59";
cout << "\n" << endl;
cout << "List of Side Orders" << endl;
cout << "1. French Fries: $0.89" << endl;
cout << "2. Onion Rings: $1.09" << endl;
cout << "3. Corn Chips: $0.59" << endl;
cout << "Please type fries, rings or chips here: " << endl;
cin >> side;
if (side == 1)
socost == "$0.99";
if (side == 2)
socost == "$1.09";
if (side == 3)
socost == "$2.59";
cout << "\n" << endl;
cout << "Receipt:" << endl;
cout << drink << ": " << dcost << endl;
cout << sandwich << ": " << swcost << endl;
cout << side << ": " << socost << endl;
return 0;
}
I really, really, really need help.