this loop is running more times then i want to and when the user puts in the wrong number how do i print out an error.
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
string answer;
int soda;
do
{
cout << "Choose a drink or 6 to quit:" << endl;
cout << "1. Coke $1.00" << endl;
cout << "2. Water Free" << endl;
cout << "3. Sprite $1.25" << endl;
cout << "4. Dr. Pepper $1.75" << endl;
cout << "5. Lemonade $.60" << endl;
cout << "6. Quit! \n" << endl;
cin >> soda;
if(soda == 1)
cout << "You purchased Coke for a cost of $ " << endl;
if(soda == 2)
cout << "You purchased Water for a cost of $" << endl;
if(soda == 3)
cout << "You purchased Sprite for a cost of $" << endl;
if(soda == 4)
cout << "You purchased Dr. Pepper for a cost of $" << endl;
if(soda == 5)
cout << "You purchased Lemonade for a cost of $" << endl;
}
while (soda != 6);
}