We need more info. Specifically, on what condition should the loop terminate?
There are 3 basic loops.
1 - while loops: Used in cases where there is a possibility that the body of the loop should never be run. The while condition is tested before the body of the loop is run.
2 - do{} while loops: Use when the body of the loop should always be executed at least once. The while condition is tested after the body is run.
3 - for() loops: Used when the number of times you will iterate through the loop is known beforehand. Often used to iterate through arrays, vectors, and other list structures.
These are broad guidelines for which loop to use, not strict rules. Knowing which loop to use will come with experience.
<edit>Nevermind, I missread your post in haste. Since you know the number of drinks use a 'for' loop. for( int i = 0; i < numDrinks; i++)
the for loop, while loop, and do while loops all have same stuff. pick one.
for (i = 0; i < 3, i++) // if only one line under for loop, then no braces needed
{
...
}
while (i < 3) // like mid of for loop, int or char i declaration should come before loop
{
...
i++; // incrementer/decrementer etc has to be added unlike for loop has this
}
do
{
...
i++; // like while loop has to be added
} while (i < 3);