Creating objects of the Currency class require a name (string), a currency symbol (string) and the number of decimal places (integer) usually associated with the currency (in that order).

Creating objects of the Currency class require a name (string), a currency symbol (string) and the number of decimal places (integer) usually associated with the currency (in that order).

LANGUAGE: C++

CHALLENGE:

Creating objects of the Currency class require a name (string), a currency symbol (string) and the number of decimal places (integer) usually associated with the currency (in that order). Creating objects of the Money class require a Currency object, and the actual amount (integer) (in that order).

Define an object of type Currency named canadianDollars and corresponding to the name “Canadian Dollar”, the symbol “C$”, and 2 decimal places. Define an object of type Money named valueInCanadians corresponding to 230 units of canadianDollars.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level