subject
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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
The three logical operators used to write compound conditions are "and," "or," and "not." a: true b: false
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which set of steps will organize the data to only show foods with more than 100 calories and rank their sugar content from greatest to least?
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
1) Create a "MainNote" currency class with two integer attributes and one string attribute, all of w...
Questions
question
Chemistry, 18.08.2019 15:30
question
Mathematics, 18.08.2019 15:30
question
Social Studies, 18.08.2019 15:30
Questions on the website: 13722361