Question: Python Code Create a Money class that can store dollars and cents. Please include code for the following functionality to your Money class 1. default
Python Code

Create a Money class that can store dollars and cents. Please include code for the following functionality to your Money class 1. default Constructor with two arguments (dollars , cents) 2. repr overloading for Canonical string representation 3. str overloading for informal string representation 4. get dollars() 5. get cents() 6. set dollars() 7. set cents) 8. overload operator for + 9. overload operator for 10. overload operator for = 11, overload operator for > 12, overload operator for >- 13, overload operator for>> ml Money ( ) ml $0.0 >>>print(ml) $0.0 >>ml.set dollars (9) >>ml.set cents (99) >>>m1 $9.99 ml.get_dollars() >>>m1.get cents( >>> m2 = Money ( 2 , 56) >m2 $2.56 >>> ml + m2 $12.55 > mlm2 $7.43 False >>>ml m2 True >>> m1 >= m2 True >>> ml
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
