CJCoding With Joseph
15free / daySign inCreate account

You are implementing deposits and withdrawals for a wallet balance.

Create a class Wallet that stores the balance using TWO ints: dollars and cents. - cents should always be 0..99 (normalize after operations).

Requirements: 1) Constructor Wallet(int dollars, int cents) 2) int getCents() const (return TOTAL cents) 3) operator+=(int cents) deposits that many cents 4) operator-=(int cents) withdraws that many cents

Do NOT write a main function.

Expected output

150
30

= newline. The output ends with a newline, so print one after the last line.

Hints4 available
Topics
ClassesOperator Overloading
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)

Your output

Run your code to see the output here...

Test cases

Run your code to see test case results.