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 05:30
The total revenues for a company are $150,223 and the total expenses were 125,766. if you are calculating the net income, which of these spreadsheets would you use? insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2-b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2+b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2/b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2*b3. the formula should be showing in the formula bar.
Answers: 3
question
Computers and Technology, 23.06.2019 19:30
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
question
Computers and Technology, 24.06.2019 13:00
Which best describes the condition under which the unicode output is the same as plain text ?
Answers: 1
You know the right answer?
1) Create a "MainNote" currency class with two integer attributes and one string attribute, all of w...
Questions
question
Mathematics, 22.07.2020 05:01
question
Mathematics, 22.07.2020 05:01
question
Mathematics, 22.07.2020 05:01
question
Mathematics, 22.07.2020 05:01
question
History, 22.07.2020 05:01
question
Mathematics, 22.07.2020 05:01
Questions on the website: 13722361