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 10:00
Businesses allocate resources for their best and most productive uses. the more a resource, the more costly it will be. a manufacturer that requires scarce and costly resources is likely to charge for its products.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
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
Mathematics, 29.07.2020 18:01