this code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#include <iostream>
using namespace std;
int main()
{
cout<<"Welcome to the piggybank counter. This program is\n"
"basically a glorified calculator! You put in the total\n"
"number of each type of coin in your piggy bank when prompted.\n"
"\n";
cout<<"Before starting, it might help if you put the coins\n"
"into different piles in order to help you count them.\n"
"\n";
int POUNDS;
int PENCE;
int A;
(PENCE=100);
cout<<"So, now you've done that, let's get started. How many one\n"
"pound coins do you have? Press ENTER after putting the number in.\n";
cin>>POUNDS;
cin.ignore();
cout<<"\n"
"Ok, that makes "<<POUNDS*PENCE<<" pence.\n"
"\n";
A = (POUNDS * PENCE);
int B;
cout<<"Braw, now put in the number of 50 pence \n"
"pieces that you've got. Mind and press ENTER!\n";
cin>>B;
cin.ignore();
cout<<"\n";
int C;
cout<<"Ok, how about 20 pence pieces?\n";
cin>>C;
cin.ignore();
cout<<"\n";
int D;
cout<<"So how many 10 pence pieces do you have?\n";
cin>>D;
cin.ignore();
cout<<"\n";
int E;
cout<<"Just the small change to go now!\n"
"How many 2 pences have you got?\n";
cin>>E;
cin.ignore();
cout<<"\n";
int F;
cout<<"And finally, how many pennies?\n";
cin>>F;
cin.ignore();
cout<<"\n";
cout<<"In your piggybank, you have "<<(A+B+C+D+E+F)<<" pence\n.";
int TPENCE = (A+B+C+D+E+F);
int TPOUNDS = (TPENCE/100);
cout<<"Which is "<<TPOUNDS<<" in pounds!";
cout<<"Please press ENTER to terminate the program.\n";
cin.ignore();
return 0;
}
|
gave out this output with these values
Welcome to the piggybank counter. This program is
basically a glorified calculator! You put in the total
number of each type of coin in your piggy bank when prompted.
Before starting, it might help if you put the coins
into different piles in order to help you count them.
So, now you've done that, let's get started. How many one
pound coins do you have? Press ENTER after putting the number in.
5
Ok, that makes 500 pence.
Braw, now put in the number of 50 pence
pieces that you've got. Mind and press ENTER!
2
Ok, how about 20 pence pieces?
5
So how many 10 pence pieces do you have?
10
Just the small change to go now!
How many 2 pences have you got?
50
And finally, how many pennies?
100
In your piggybank, you have 667 pence
.Which is 6 in pounds!Please press ENTER to terminate the program.
this is what values i gave in that program, but what is the answer suppose to be??
int A will always be (pounds * 100)
not knowing this currency, i have no idea how to get the outcome proper