Question: Please answer the following using Python: Create a Money class that can store dollars and cents . Please include code for the following functionality to
Please answer the following using Python:
Create a Money class that can store dollars and cents. Please include code for the following functionality to your Money class
default Constructor with two arguments (dollars , cents)
repr overloading for Canonical string representation
str overloading for informal string representation
get_dollars()
get_cents()
set_dollars()
set_cents()
overload operator for +
overload operator for
overload operator for ==
overload operator for >
overload operator for >=
overload operator for
overload operator for =

Sample shell with Money obiects: >>> m1 = Money() >ml $0.0 >>> print (ml) $0.0 >ml.set dollars (9) >ml.set cents (99) >>ml $9.99 ml.get dollars( >>>ml.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
