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, 21.06.2019 20:20
Wireless communications is likely to be viewed as an essential part of an enterprise network infrastructure when: select one: a. mobile communication is needed b. communication facilities must be installed at low initial cost c. communication must take place in a hostile or difficult terrain that makes wired communication difficult or impossible d. the same information must be broadcast to many locations
Answers: 1
question
Computers and Technology, 22.06.2019 04:30
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topic? one clue is the type of web site it is--the domain name ".org" tells you that this site is run by a nonprofit organization.
Answers: 2
question
Computers and Technology, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Best laptops for college [$100-$500 range]?
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, 11.02.2020 00:36
Questions on the website: 13722360