imxelite Level: Protégé
 Registered: 01-10-2005 Posts: 4
|
Please help with problem with my total
Hi,
I was having trouble calculating my total for a menu I'm trying to make for class. Could someone look at the code below and tell how do I go about making the computer total what the user enters?
#include <iostream>
#include <string>
using namespace std;
string Rye, Wheat, White, Sourdough, Pumpernickel;
string Ham, Beff, Reuben, PBJ, Cheese, Vegetarian;
string Mayo, Mustard, Ketchup, None;
string Coke, Diet, Tea, Coffee, Water;
double coke = 1.25, diet = 1.25, tea = 1.00, coffee = 1.00, water = 1.00;
int main()
{
cout << "Welcome to the Sandwich Corral" << endl;
cout << "You will be given choices for building your sandwich." << endl;
cout << "Please enter your selection after each prompt and then press " <<
"the enter key."<< endl;
cout << "Please enter your meat choice:"<< endl;
cout << "Ham," " Beef," " Reuben," " PBJ," " Cheese," " or" " Vegetarian"<< endl;
cin >> Ham, Beff, Reuben, PBJ, Cheese, Vegetarian;
cout << "Please enter your bread choice:"<< endl;
cout << "Rye," "Wheat," "White," "Sourdough," "or Pumpernickel"<< endl;
cin >> Rye, Wheat, White, Sourdough, Pumpernickel;
cout << " Please enter your choice of condiment (one only):"<< endl;
cout << "Mayo, Mustard, Ketchup, or None:"<< endl;
cin >> Mayo, Mustard, Ketchup, None;
cout << "Please enter your drink choice" << endl;
cout << "Coke, Diet, Tea, Coffee, or Water:" << endl;
cin >> Coke, Diet, Tea, Coffee, Water;
cout << "Please enter 3.99 for a half sandwich or 5.99 for a whole" <<
cout << " sandwich: 3.99"<< endl;
cout << "You have entered the following information:"<< endl;
cout << "Sandwich:"<< endl;
cout << "Bread:"<< endl;
cout << "Condiment:"<< endl;
cout << "Drink:"<< endl;
cout << "Tab:"<< endl;
return 0;
}
[Edited by imxelite on 01-10-2005 at 01:00 AM GMT]
|