I have been working on the code listed here.
I am working on Problem #2, 0 stars. Here's what I have to do:
Write a program that presents the user w/ a choice of your 5 favorite beverages (Coke, Water, Sprite, ... , Whatever). Then allow the user to choose a beverage by entering a number 1-5. Output which beverage they chose.
NOTE: I won't be creating a switch statement or making a error message if you give a value other than one that is 1-5, because that are part of the next step in the project.
using std::cout;
using std::cin;
using std::endl;
int main()
{
int UserSodaChoice;
cout << "Cola Machine V1" << endl;
cout << "1. Coca-Cola" << endl;
cout << "2. Sprite" << endl;
cout << "3. Fanta" << endl;
cout << "4. Mountain Dew" << endl;
cout << "5. Pepsi" << endl;
cout << "Pick your favorite beverage: ";
cin >> UserSodaChoice;
if (UserSodaChoice == 1)
{
cout << "I don't like Coca-Cola...";
}
if (UserSodaChoice == 2)
{
cout << "Sprite is ok I guess.";
}
if (UserSodaChoice == 3)
{
cout << "Waayyyy too much sugar.";
}
if (UserSodaChoice == 4)
{
cout << "Mountain Dew! Nice.";
}
if (UserSodaChoice == 5)
{
cout << "Eww. People don't drink Pepsi these days, it ain't the 90's.";
}
cout << "\n\n\n\t\t\t";
}
camelCase
orsnake_case
, whilePascalCase
is reserved for type definitions (classes, etc.). \$\endgroup\$strHelloWorld
,bIsRaining
,btnCancel
,$this
) \$\endgroup\$UserSodaChoice
is a variable rather than a class or a struct, it should beuserSodaChoice
or similar instead. (You'll notice that the highlighting here will even change!) \$\endgroup\$