Hi I'm a new programmer just learning the basics of C++. I have created a very small section of code simply to practice the syntax of C++ and reinforce certain concepts. The program is a vending machine replica using if, else if and else statements to read the user input and display what they have choosen.
But for some reason my entire block of If/Elses is being ignored. When I've tried the debugger stopping at any section of it the program simply doesn't stop and when I've put the debugger somewhere else and tried to insert the red stop dot into the if statements I get a message saying "no executable code is associated with this line."
Here is my code
#include <iostream>
using namespace std;
int main ()
{
//Greets the user
cout << "Welcome to the cola machine" << endl;
cout << "Please choose your beverage from the list below\n\n";
//Lists the options for the user
cout << "1 - Coca-Cola" << endl;
cout << "2 - A & W Root Beer" << endl;
cout << "3 - Sprite" << endl;
cout << "4 - Pepsi" << endl;
cout << "5 - Mountain Dew" << endl;
int pop;
cin >> pop;
if (pop == 1)
{
"\nCoca-Cola";
}
else if (pop == 2)
{
"\nA & W Root Beer";
}
else if (pop == 3)
{
"\nSprite";
}
else if (pop == 4)
{
"\nPepsi";
}
else if (pop == 5)
{
"\nMountain Dew";
}
else
{
"\nError. choice was not valid, here is your money back.";
}
//Pauses program at end because I'm lazy
system("pause");
return 0;
}
So yeah any help or suggestions would be appreciated.
P.S. Sorry if I made any mistakes on this post it's my first of what will hopefully be many posts. Any constructive criticism on how I made my post or even how I'm self-teaching my coding would be appreciated.