
Anyone who has solution of this program C++?
Design a program that receives data as a whole, corresponding to an amount of money and
calculates and prints the best breakdown (the minimum number of currency units). Units
currency are: (10000,5000,2000,1000,500,200,100,50,25,… The program stores these
quantities ordered and broken down into a vector quantity in increasing order of
components of the vector. After printing the breakdown, the program will break down further
quantities, printed at the end the total number of banknotes and coins of each class.
You do not need to take into account cents. Coins / notes to consider are:
500,200,10,50,20,10,5,2,1 Euros.
int currency[9] = {10000,5000,2000,1000,500,200,100,50,25}…
int counts[9];
for (int i = 0; i < 9; i++)
{
counts[i] = amount / currency[i];
amount -= counts[i] * currency[i];
}
The above loop will go through each currency and figure out how many of each is in the amount. It then saves that in counts.
The total amount is then reduced so for the next currency it is only dealing with what is left.
You can go through the counts array to display the amount per currency.
Your currency list was short so you will probably have more than 9.
Local Community Currency Money – Stephanie Mills – 1 of 2
| | QUEEN NEFERTITI KING TUT EGYPT CURRENCY MONEY BILL NOTE UNCIRCULATED BANKNOTE $4.99 |
| | TAIWAN 100 Yuan Banknote World Money UNC Currency Asia Note BILL 2011 (CHINA) $12.99 |
| | TURKEY 1 Lirasi Banknote World Money UNC Currency Asia Note BILL pick 216 2005 $4.99 |
| | CROATIA 10 Dinara Banknote World Money UNC Currency p18 Europe Note 1991 BILL $3.99 |
| | BAHRAIN ½ Dinar Banknote World Money UNC Currency Asia Note p25 – 2008 Bill $6.99 |
| | BELARUS 50 Ruble-1992- Banknote World Money Currency Uncirculated CONSECUTIVE $2.50 |
| | MACEDONIA 10 Denari Banknote World Money UNC Currency Europe BILL p14g 2007 Note $5.99 |
| | BELARUS 1992-100 Ruble Banknote World Money Currency -uncirculated-consecutive $2.95 |
| | NICARAGUA ½ Cordoba Banknote World Money Currency BILL Central America Note p171 $5.99 |
| | PAKISTAN 5 Rupee Banknote World Paper Money Currency aUNC Asia Bill p38 Note $3.49 |
| | RUSSIA 1000 Rubles Banknote World Money Currency BILL Last Lennin note p250 1992 $6.99 |
| | SERBIA 20 Dinara Banknote World Money Currency BILL Europe Note Replacement p47z $7.99 |
| | SINGAPORE $2 Dollars Banknote World Money UNC Currency Asia Bill Ship Note p38 $8.99 |
| | BANGLADESH 60 Taka Banknote World Currency Money BILL Asia Note Commemorative $5.99 |
| | ZAMBIA 50 Kwacha World Paper Money Banknote Africa Currency pick 37d Bird Eagle $3.99 |
| | ZAMBIA 50 Kwacha World Money Banknote Africa UN Currency p37d Bird Eagle RADAR # $6.99 |
| | SURINAME 5 Gulden Banknote World Money UNC Currency BILL South America note p125 $3.99 |
| | ZAMBIA 50 Kwacha World Money Banknote Africa Currency p37d Bird Eagle RADAR # BB $6.99 |
| | JAMAICA 500 Dollars Banknote World Paper Money Currency BILL pick 85 2008 Note $19.99 |
| | ► Canada 1967 Note 1 dollar P-84a Banknote au $9.99 |
| | KOREA South 10 Jeon Banknote World Money UNC Currency Asia Note BILL p28 1962 $3.99 |
| | 50 PIASTRES PHARAOH RAMESSES THE GREAT EGYPT CURRENCY NOTE UNC BANKNOTE MONEY $2.30 |
| | 2006 5000 WON KIM JONG-IL NORTH KOREA CURRENCY UNCIRCULATED BANKNOTE NOTE MONEY $8.50 |
| | 2010 1 ONE PESO CUBA CUBAN CURRENCY UNCIRCULATED BANKNOTE NOTE MONEY BILL CASH $1.36 |
| | 2004 3 PESOS ERNESTO EL CHE GUEVARA CUBA CUBAN CURRENCY UNC BANKNOTE NOTE MONEY $6.01 |
| | 1960 50 PESOS CHILE CURRENCY UNCIRCULATED BANKNOTE NOTE MONEY BILL CASH FREE S&H $0.55 |
| | ANTARCTICA $20 Banknote World Currency Money SPECIMEN $29.99 |
| | 1962 10 CRUZEIROS BRAZIL CURRENCY NOTE BILL GEM UNCIRCULATED BANKNOTE MONEY CASH $0.70 |
| | VENEZUELA 5 Bolivares Banknote World Money UNC Currency $2.99 |
| | ARGENTINA 5 Pesos Banknote World Paper Money Currency $3.99 |
| | ( 5 ) Plastic Currency Dollar Money Holder Cases For BEP Pack of 100 Bank Notes $89.75 |
| | UNC NEW CHINA 1 YI JIAO BANKNOTE 1980 PAPER MONEY CHINESE CURRENCY $0.76 |
| | MOZAMBIQUE 500 Meticais Banknote World Money Currency $9.99 |
| | WW II Japanese invasion money ONE PESO BANK NOTE Currency Lot of 3 $3.99 |
| | WW II Japanese invasion money EEN CENT BANK NOTE Currency Lot of 5 $4.99 |
| | SINGAPORE 2 Dollars Banknote World Money UNC Currency Asia Bill Ship Note p34 $7.99 |
| | 1999 1 YUAN MAO ZEDONG CHINA CHINESE CURRENCY UNC BANKNOTE NOTE MONEY BILL CASH $4.25 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY MONGOLIA 1 TUGRIK UNCIRCULATED BANKNOTE $0.60 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY CAMBODIA 100 RIELS UNCIRCULATED BANKNOTE $0.50 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY LAOS 10 KIP UNCIRCULATED BANKNOTE $2.24 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY MYANMAR 5 KYATS UNCIRCULATED BANKNOTE $0.50 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY MYANMAR 10 KYATS UNCIRCULATED BANKNOTE $0.28 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY ZIMBABWE 5 DOLLARS UNCIRCULATED BANKNOTE $0.92 |
| | FOREIGN WORLD PAPER MONEY / CURRENCY INDONESIA 10 SEN UNCIRCULATED BANKNOTE $0.29 |
| | 1 Used Signed Brazil Bank Note World Paper Money Foreign Currency w69 $12.00 |
| | 1 New Signed Brazil Bank Note World Paper Money Foreign Currency w70 $26.00 |
| | Mixed lot of 10 Zimbabwe banknotes-includes 100 Trillion.Money currency K $14.99 |
| | 1953 STAR★$5.00 DOLLAR BILL OLD US BANK NOTE PAPER MONEY CURRENCY RED SEAL STAMP $31.00 |
| | 1928 $2 DOLLAR BILL OLD US BANK NOTE PAPER MONEY CURRENCY RED SEAL STAMP TWO PMG $36.00 |
| | Paper Money Currency Banknotes Holder 20/40 Pockets Album (Green Front Cover) $8.99 |
| | 25 Banknote Sleeve Currency Holder Paper Money Cover $8.95 |
| | SURINAME 25 Gulden Banknote World Money Currency South America Bill p127b Note $4.99 |
| | SUDAN 1 Pound Banknote World Money Currency BILL p39 $3.99 |
| | CONGO Democratic Republic 10 Francs Banknote World Money Currency Bill Africa $4.99 |
| | KAZAKHSTAN 1 Tenge Banknote World Money UNC Currency Bill Europe note p7 – 1993 $4.99 |
| | TURKEY 100 Lirasi Banknote World Money Currency Asia Note BILL pick 189 – 1972 $6.99 |
| | MEXICO 10 Pesos Banknote World Money UNC Currency p63f Note North America Bill $4.99 |
| | PHILIPPINES 10 Piso Banknote World Paper Money Currency p169b – Asia BILL Note $4.99 |
| | France 1944 WWII 5 FRANCS Currency Banknote Paper Money $9.99 |
| | France 1940 – 50 CINQUANTE FRANCS Currency Banknote Paper Money $9.99 |
| | France 1944 WWII Replacement 2 FRANCS Currency Banknote Paper Money $9.99 |
| | France 1944 WWII Replacement 5 FRANCS Currency Banknote Paper Money $9.99 |
| | LIBERIA $ 5 Dollars Banknote World Money UNC Currency BILL 2006 Africa note p26c $4.99 |
| | AFGHANISTAN 100 Afghans Banknote World Money Currency Asia note p58 BILL 1979 $5.99 |
| | CAMBODIA 2000 Riels Banknote World Money UNC Asia Currency p59 BILL 2007 note $4.99 |
| | MONGOLIA 5 Tugrik Banknote World Paper Money UNC Currency 2008 BILL Horses note $3.99 |
| | Mixed lot of 10 Zimbabwe banknotes-includes 100 Trillion.Money currency B $14.99 |
| | CAMBODIA 20 Riels Banknote World Money aUNC Asia Currency pick 31 BILL 1979 note $4.49 |
| | AZERBAIJAN 5 Manat Banknote World Currency Money BILL $34.99 |
| | ARMENIA 25 Dram Banknote World Money UNC Currency BILL Asia Note p34 Armenian $3.99 |
| | AZERBAIJAN 250 Manat Banknote World Currency Money BILL $4.99 |
| | BRAZIL 1 Cruzeiro Banknote World Money Currency BILL South America Note p191Ab $3.99 |
| | ► Mongolia 2007 Note 10 tugrik P-62 banknote unc $0.79 |
| | ► Belarus 2000 Note 10 rublei P-23 Banknote unc $0.79 |
| | ► Croatia 1991 Note 10 dinara P-18 Banknote unc $0.99 |
| | ► China 1953 Note 1 fen P-860c Banknote unc $0.69 |
| | ► Belarus 2000 Note 100 rublei P-26 Banknote unc $0.69 |
| | ► Croatia 1991 Note 1 dinara P-16a Banknote unc $0.69 |
| | ► Belarus 1982 Note 100 rublei P-8 Banknote unc $0.79 |
| | ► Belarus 2000 Note 5 rublei P-22 Banknote unc $0.39 |
