Question: 1. Do you remember our money type from lab 3? You need to implement this ADT again, this time in Python. In the text editor

 1. Do you remember our money type from lab 3? You

1. Do you remember our money type from lab 3? You need to implement this ADT again, this time in Python. In the text editor of your choosing create a file money-py and define class MoneyType, with its properties and methods described below - make sure you use the exact same names as indicated in the description. Test all methods below your class definition (i.e. in the same file - we will use your code to verify you tested thoroughly and then run it to verify correctness). No credit for un-tested functionality, as in Python the code is not verified until run-time. a. constructor that takes two parameters that are to be used for dollars and cents, and assigns their values to private fields; the constructor should provide default values of 0 for these parameters (do NOT worry about normalizing the values) b. a class level field that counts the number of MoneyType objects (needs to be updated inside the constructor; make sure you test it as well) c. getters and setters for each of the properties str_method that returns a money object as a string - format the string in some fashion, e.g. $1.12 add method that takes another MoneyType object and returns a new MoneyType object that is the result of adding self and param (if you name this method correctly, then it means that in Python you overloaded the addition operator and in your test code, you can use something like object3 = object1 + object2); do NOT worry about normalizing the values d. e

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!