subject

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 . . .

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 22.06.2019 23:50
You need to design a circuit that implements the functions in the following table: s0 s1 function0 0 a + 10 1 a – b1 0 a + b1 1 a – 1s0 and s1 are 1-bit control inputs to select the function of the circuit. inputs a and b are 4-bitnumbers in 2s complement form. the output is also a 4-bit number in 2s complement form.you are allowed to use only one ttl 7483 4-bit adder to implement all the functions. but anynumber of other components (except the adder) can be used.hint: design a combinational logic circuit to modify the input b and the “carry input” of theadder depending on the control inputs s0 and s1.important: lab grade will depend on the working of the circuit & will be checked of by your labinstructor.1. is the output valid for the following input combinations: a. s0 = 0, s1 = 0, a = 7, b = 3? b. s0 = 0, s1 = 1, a = 7, b = 3? c. s0 = 1, s1 = 0, a = -4, b = -5? d. s0 = 1, s1 = 1, a = -8, b = 6? 2. what is the range of inputs (for both a and b) that will produce the valid output for all the functions?
Answers: 3
You know the right answer?
Programming problem: Currency Simulator A. Create an abstract Dollar class with two integer attribut...
Questions
question
Physics, 03.07.2019 17:00
Questions on the website: 13722361