#include <iostream>
using namespace std;
int main()
{
char key;
do {
cout << "Please choose a drink or \'T\' for the exit :" << endl << endl;
cout << "\t[C] Coke" << endl;
cout << "\t[S] San Miguel" << endl;
cout << "\t[T] Quit" << endl;
key = cin.get();
cin.clear();
while (cin.get() != '\n');
key = tolower(key);
if (key != 'c' && key != 's' && key != 't') {
cout << "Incorrect input. Enter \'C\', \'S\' or \'T\'." << endl << endl;
}
switch (key)
{
case 'c': cout << "\tCoke 1.5l - 65.00" << endl; break;
case 's': cout << "\t San Miguel 1l - 120.00" << endl; break;
default:
break;
}
cout << endl;
} while (key != 't');
return 0;
}
Comments
Leave a comment