If you want an operation to be preform *untill something you should use a loop
#include <iostream>
using namespace std;
int main()
{
double bill, ten, fifteen, twenty, end, end2, end3;
bool done = false;
while(!done){
cout << "Enter your bill's total: ";
cin >> bill;
ten = 0.1;
fifteen = 0.15;
twenty = 0.2;
end = ten * bill;
end2 = fifteen * bill;
end3 = twenty * bill;
cout << "10%: " << end << endl;
cout << "15%: " << end2 << endl;
cout << "20%: " << end3 << endl;
cout << "again? y/n";
char res;
cin >> res;
if(res == 'n')
done=true;
}
system("pause");
return 0;
}
0
solved How would I allow user to use program again? [closed]