Hello, I'm missing something very simple here. I would appreciate it if someone could tell me what exactly it is. As a training exercise I am writing up a quick function which asks what kind of soda you'd like to choose etc. Regardless when I run it, It constantly repeats it self. May have something to do with the answer being letters rather than numbers, not sure.
#include <iostream>
//@author Will A Cola Machine Training Exercise
int main()
{
int soda = 0;
int cocacola = 0;
int sprite = 0;
int pepsi = 0;
int drpepper = 0;
bool repeat = true;
while(repeat)
{
std::cout<<"Soda Machine ||| Created By Will A.\n Inspired By BlitzCoder";
std::cout<<"\n\n\n\nPlease Enter CocaCola, Sprite, Pepsi or DrPepper:\n\n";
std::cin>>soda;
if((cocacola))
{
std::cout<<"\n\n\nYou recieve a can of Coca-Cola!\n";
}
elseif((sprite))
{
std::cout<<"\n\n\nYou recieve a can of Sprite!\n";
}
elseif((pepsi))
{
std::cout<<"\n\n\nYou recieve a can of Pepsi!\n";
}
elseif((drpepper))
{
std::cout<<"\n\n\nYou recieve a can of DrPepper!\n";
}
else
{
std::cout<<"Please choose the following!\nEnter CocaCola, Sprite, Pepsi or DrPepper:\n\n";
}
}
}