void function2() // Retail sale
{char cont1 = char();
bool flag1 = true;
while ( true )
{char cont = char();
bool flag = true;
while ( true)
{int unit = int();
double total = double();
cout << "How many unit do you want? ";
cin >> unit;
if (cin.fail())
{//cout << "Invalid data" << endl << endl;
cin.clear();
????????????????????????????????????????????
(What do I put to make the loop keep going?)
????????????????????????????????????????????
cout << endl;
}
if ( unit > 0)
{total = unit * 15;
cout << total << "$" << endl;}
cout << "Continue? ";
cin >> cont; //system("pause");
cout << endl;
if ( cont == 'y' || cont == 'Y' )
{flag = true;}
else
{flag = false;}
}//end while loop
2006-10-27
15:29:41
·
3 answers
·
asked by
Jackie...boy
1
in
Computers & Internet
➔ Programming & Design