Computers and Technology

Programming problem: Currency Simulator A. Create an abstract Dollar class with two integer attributes, both of which are non-public (Python programmers - it is understood that there is nothing private in Python but try to not access the attributes directly from outside the classes) The int attributes will represent whole part (or currency note value) and fractional part (or currency coin value) such that 100 fractional parts equals 1 whole part. B. Create three derived classes - USD, CAD and AUD - each with one additional non-public string attribute which will contain the name of the country - USA, Canada and Australia respectively. C. In your currency classes, add public methods for the following, where appropriate: Default Construction (i. e. no parameters passed) Construction based on parameters for all attributes Copy Constructor and/or Assignment, as applicable to your programming language of choice Destructor, as applicable to your programming language of choice • Setters and Getters for all attributes Adding two objects of the same currency Subtracting one object from another object of the same currency Comparing two objects of the same currency for equality/inequality Comparing two objects of the same currency to identify which object is larger or smaller Print method to print details of a currency object . . . . . . D. Create a Wallet class with one attribute - an array of three Dollar references / pointers and the following methods to demonstrate polymorphism of the currencies: • A default Constructor which sets o the first element of the array to a zero value USD object o the second element of the array to a zero value CAD object o the third element of the array to a zero value of AUD object A Destructor, as applicable to your programming language of choice • Methods to add or subtract currency objects appropriately using Dollar references / pointers, i. e. o USD objects to/from the first element only. CAD objects to/from the second element only and • AUD objects to/from the third element. Do not write currency specific add/subtract methods in the Wallet as that would defeat the purpose of polymorphism • Methods to compare if the value of either element is greater or smaller than an input value using Dollar references only. This method can be called upon in the subtract method above as needed. . A method to Print the values of the three elements in the Wallet E. In your main: Create a Wallet object Provide the user a main menu to add/ subtract/compare the USD, CAD and AUD values in the Wallet as well as print the contents of the Wallet • You can use a second level menu choice to allow the user to select currency type • Based on user choice, create either USD CAD AUD objects as needed to perform the desired operations. . The main menu should be run in a loop until the user selects the Exit option • There is no sample output - you are allowed to provide user interactivity as you see fit and programs will be graded for clarity of interaction . . .

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, mariap3504
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
image
Computers and Technology, 22.06.2019 16:00, sdonachy7
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 3
image
Computers and Technology, 23.06.2019 11:30, kyraj21
Which excel file extension stores automated steps for repetitive tasks?
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, Alexaisokay1
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
Do you know the correct answer?
Programming problem: Currency Simulator A. Create an abstract Dollar class with two integer attribut...

Questions in other subjects:

Konu
Physics, 02.10.2020 21:01
Konu
History, 02.10.2020 21:01
Konu
Mathematics, 02.10.2020 21:01