Computers and Technology
Computers and Technology, 17.10.2020 19:01, kezin

1) Create a "MainNote" currency class with two integer attributes and one string attribute, all of which are non-public. The int attributes will represent the whole part (or currency note value) and fractional part (or currency coin value) such that 100 fractional parts equal 1 whole part. The string attribute will represent the currency name.2) Create a "OtherDollar" derived/inherited class with one additional non-public double attribute to represent the conversion factor from/to US Dollar. The value of the conversion factor can be defaulted in the class definition based on 1 MN = 1.36 OD or 1 OD = 0.74 MN. Also, 1000 of OD fractional parts equals 1 OD whole part.3) In your two currency classes, add public methods for the following:Default Construction (i. e. no parameters passed)Construction based on parameters for all attributesCopy Constructor and/or Assignment, as applicable to your programming language of choiceDestructor, as applicable to your programming language of choiceSetters and Getters for all attributesAdding two objects of the same currencySubtracting one object from another object of the same currencyComparing two objects of the same currency for equality/inequalityComparing two objects of the same currency to identify which object is larger or smallerPrint method to print details of a currency objectIn your derived class only, methods to convert MN objects to OD and vice versa4) Create a "Purse" class with one attribute - an array of two "MainNote" references/pointers and the following methods to demonstrate polymorphism of the currencies:A default constructor which sets the first element of the array to a zero value MainNote objectthe second element of the array to a zero value OtherDollar Dollar objectA destructor, as applicable to your programming language of choiceMethods to add or subtractMN objects to/from the first element only andOD objects to/from the second element onlyMethods to compare if the value of either element is greater or smaller than an input valueA method to print the values of the two elements in the Purse class5) In your main:Create a Purse objectProvide the user a "main menu" to add and subtract as well as compare the MainNote and OtherDollar values in the Purse as well as print the contents of the PurseYou can use a second level menu choice to allow the user to select currency typeBased on user choice, create either MainNote or OtherDollar objects as needed to perform the desired operations. The main menu should be run in a loop until the user selects the Exit option

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:40, malibu777
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
image
Computers and Technology, 22.06.2019 14:30, camerondillonn
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
image
Computers and Technology, 23.06.2019 08:30, Calirose
When you interpret the behavior of others according to your experiences and understanding of the world your evaluation is
Answers: 1
image
Computers and Technology, 23.06.2019 12:30, legend101xD
Animations and transitions are added from the
Answers: 1
Do you know the correct answer?
1) Create a "MainNote" currency class with two integer attributes and one string attribute, all of w...

Questions in other subjects:

Konu
Mathematics, 24.05.2021 04:10
Konu
Engineering, 24.05.2021 04:10