Python Program for Currenct Simulator. Create 4 python code files for Currency, Dollar and Pound classes and one for the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Python Program for Currenct Simulator. Create 4 python code files for Currency, Dollar and Pound classes and one for the

Post by answerhappygod »

Python Program for Currenct Simulator. Create 4 python codefiles for Currency, Dollar and Pound classes and one for theMain.py
1) Create an abstract base classcalled Currency with two integer attributes,both of which are non-publicThe int attributes will represent wholepart (or currency note value) and fractional part (or currency coinvalue) such that 100 fractional parts equals 1 wholepart.
. In your base Currency class, addpublic methods for the following, where appropriate (C++ studentsare allowed to use friend methods asoverloads only, i.e. the corresponding class method needs to bedefined first; Do not use overloaded operators in C++/Python):
2 class files for Dollar.py and Pound.py
Create two derived classes- Dollar and Pound - with one additionalnon-public string attribute which willcontain the name of the currency (Dollar or Pound) respectively. DONOT add this attribute to thebase Currency class.In yourderived Dollar and Pound classes,add new methods or override inherited methods as necessary, takingcare that code should not be duplicated or duplication minimized.Think modular and reusable code.
In your main:
Invalid addition
1.11 Pound 12.12 Dollar
Invalid subtraction
1.11 Pound 2.25 Dollar
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply