[Solved]Know Posted Solutions Either Incomplete Fulfill Requirements Made Entire Program M Missing Q37130470
I know this has been posted before, but all the solutions wereeither incomplete or did not fulfill all the requirements. I havemade the entire program but I’m missing part E and all thepolymorphic construction and destruction. So all the classes andmain files are easy but the polymorphic construction is the hardestpart of this problem. Language is C++. Also having trouble withadding and subtracting since the polymorphic construction istripping me up.
A. Create a currency class with four attributes – currency note,whole parts and fractional parts and currency coin such that 100fractional parts equals 1 whole part.
B. Create 5 derived classes for the following currencies -Dollar, Euro, Yen, Rupee and Yuan. I know this program can be donewithout inheritance but it is a requirement for this lab. You willbe adding and subtracting currency values using the form: Dollar,1, 25, cent Euro, 3, 33, cent Yen, 100, 54, sen Rupee, 7, 11, paiseYuan, 50, 86, fen
C. Define 3 or 4 overloaded operators to add, subtract andcompare different currency objects – care should be taken that youcan only perform these operation on objects of the same currency.Also, take care that fractional parts roll into whole parts.
D. Define an overloaded input stream operator to accept valuesof any currency as well as an overloaded output stream operator towrite out the value of the currency..
E. When initializing currency objects, your code shoulddemonstrate polymorphic construction. Your constructors should alsouse initialization lists.
F. Now, define a Wallet class that will contain the 5 individualcurrency types above and will implement the following – number ofindividual currency types whose value is non-zero, check if acurrency type exists with non-zero value in the wallet, add moneyby currency type, remove money by currency type, zero out allcurrency types, check if wallet is empty. What this means is thatyour wallet can only contain one object of each currency type. Toadd or remove money into/from wallet, check if currency hasnon-zero value in the wallet. If so, add or remove the amountspecified.
G. Your main should pre-define the 5 different currency types asspecified above in the wallet in the form of the base currencyarray of zero values – this will help you demonstrate thepolymorphic construction. Demonstrate the overloaded subscriptoperator for the Wallet class. User should be able to add or removeas many currency values for any of the five currency types. Theuser should also be able to output the total value by name of thecurrencies in the wallet. Finally they should be able to empty thewallet and print relevant information about the operation. UserInteractivity is extremely important – give due consideration toit.
Expert Answer
Answer to I know this has been posted before, but all the solutions were either incomplete or did not fulfill all the requirements… . . .
OR

