if/else statements!

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a, b, c, d, e, f, g, h, i, j, k, l, m, n;
cout << "Hunterbucks Menu:\n";
cout << "Coffee And Cost($)\n";
cout << "(a)Regular 1.50, (b)Decaf 1.25, (c)Americano 2.25, (d)Espresso 2.25, (e)Latte 2.50, (f)Cappuccino 2.75, (g)Frappucino 2.75, (h)Macchiato 2.50\n";
cout << "Snacks And Cost ($)\n";
cout << "(i)Muffin 1.00, (j)Blueberry Muffin 1.25, (k)Raspberry Muffin 1.25, (l)Scone 0.75, (m)Blueberry Scone 1.00, (n)Croissant 0.75\n";
int userGuess;
cout << "What Would You Like To Order?\n";
cin >> userGuess;
if (userGuess == a, a, i)
cout << "$4.00\n";
else if (userGuess == b, e, l, h)
cout << "$7.00\n";
else if (userGuess == n, c)
cout << "$3.00\n";
else if (userGuess ==e, e, e, j, j, m)
cout << "$11.00\n";

return 0;
}

cygwin does not give me the correct prices when i enter the other "userGuess's". please help!
closed account (zwA4jE8b)
your if statements are incorrectly structured.

you need to do an individual test for each condition.

http://cplusplus.com/doc/tutorial/control/
Hi chimysta32,

1) Please ask direct questions. "Please help" is not a question.
2) Please post in the Beginners forum next time.
3) Please edit your post and enclose the code within code tags.
4) What do you expect if (userGuess ==e, e, e, j, j, m) to mean to a C++ compiler?
Topic archived. No new replies allowed.