This code should accept three inputs represent the money: "cent", "paper" and "coins", then calculate the total amount of the money:
int coins = 0;
int paper = 0;
int cents = 0;
int transaction = 0;
int total_money = coins + paper + cents;
cout << "Do you want to fill your piggy bank?";
cin >> transaction;
while (transaction != 2)
{
cout << "How many paper money? :";
cin >> paper;
cout << "How many coins ? :";
cin >> coins;
cout << "How many cents? :";
cin >> cents;
cout << "Do you want another transaction?";
cin >> transaction;
if (transaction == 2)
{
cout << "total in piggy bank" << total_money << endl;
}
else
{
cout << "End of the program";
}
return 0;
}
What seems to be the problem here?