IN C++
A. Create an abstract base class called Currency with two integer attributes, both of which are non-public. The int attributes will represent whole part (or currency note value) and fractional part (or currency coin value) such that 100 fractional parts equals 1 whole part.
B. Create one derived class - Money - with two additional non-public string attributes which will contain the name of the currency note (Dollar) and currency coin (Cent) respectively. DO NOT add these attributes to the base Currency class.
C. In your base Currency class, add public class (C++ students are allowed to use friend methods as long as a corresponding class method is defined as well) methods for the following, where appropriate:
Default Construction (i.e. no parameters passed)
Construction based on parameters for all attributes - create logical objects only, i.e. no negative value objects allowed
Copy Constructor and/or Assignment, as applicable to your programming language of choice
Destructor, as applicable to your programming language of choice
Setters and Getters for all attributes
Adding two objects of the same currency
Subtracting one object from another object of the same currency - the result should be logical, i.e. negative results are not allowed
Comparing two objects of the same currency for equality/inequality
Comparing two objects of the same currency to identify which object is larger or smaller
Print method to print details of a currency object
All of the above should be instance methods and not static.
The add and subtract as specified should manipulate the object on which they are invoked. It is allowed to have overloaded methods that create ane return new objects.
D. In your derived Money class, add new methods or override inherited methods as necessary, taking care that code should not be duplicated or duplication minimized. Think modular and reusable code.
E. Remember -
Do not define methods that take any decimal values as input in either the base or derived classes.
Only the print method(s) in the classes should print anything to console.
Throw String (or equivalent) exceptions from within the classes to ensure that invalid objects cannot be created.
F. In your main:
Declare a primitive array of 5 Currency references (for C++ programmers, array of 5 Currency pointers).
Ask the user for 5 decimal numbers to be input - for each of the inputs you will create one Money object to be stored in the array.
Once the array is filled, perform the following five operations:
Print the contents of the array of objects created in long form, i.e. if the user entered "2.85" for the first value, it should be printed as "2 Dollar 85 Cent".
Add the first Money object to the second and print the resulting value in long form as above.
Subtract the first Money object from the third and print the resulting value in long form as above.
Compare the first Money object to the fourth and print whether both objects are equal or not using long form for object values.
Compare the first Money object to the fifth and print which object value is greater than the other object value in long form.
All operations in the main should be performed on Currency objects demonstrating polymorphism.
Remember to handle exceptions appropriately.
There is no sample output - you are allowed to provide user interactivity as you see fit.

Answers

Answer 1

Answer:

I only do Design and Technology

sorry don't understand.


Related Questions

explain the working principle of computer? can anyone tell​

Answers

Answer:

input process and output hehe

What are some 5 constraints in using multimedia in teaching​

Answers

Answer:

Explanation:

Technological resources, both hardware and software

Technological skills, for both the students and teacher

Time required to plan, design, develop, and evaluate multimedia activities

Production of multimedia is more expensive than others because it is made up of more than one medium.

Production of multimedia requires an electronic device, which may be relatively expensive.

Multimedia requires electricity to run, which adds to the cost of its use

There are constraints in using multimedia in teaching​; The Technological resources, both hardware and software Also, Technological skills, for both the students and teacher

What is a characteristic of multimedia?

A Multimedia system has four characteristics and they are use to deliver the content as well as the functionality.

The Multimedia system should be be computer controlled. The interface is interactive for their presentation and lastly the information should be in digital.

There are constraints in using multimedia in teaching​;

The Technological resources, both hardware and software

Also, Technological skills, for both the students and teacher

Since Time required to plan, design, develop, and evaluate multimedia activities

The Production of multimedia is more expensive than others because it is made up of more than one medium.

The Production of multimedia requires an electronic device, which may be relatively expensive.

The Multimedia requires electricity to run, which adds to the cost of its use.

Learn more about multimedia here;

https://brainly.com/question/9774236

#SPJ2

Fasilitas untuk pengaturan batas kertas pada Microsoft Word adalah….

a. Margin
b. View
c. LayOut
d. Paragraph

Office 92 sering disebut juga dengan….

a. Office 3.0
b. Office 7.0
c. Office Xp
d. Office 2.0


Answers

Fasilitas untuk pengaturan batas kertas pada Microsoft Word adalah

B.View

Office 92 sering disebut juga dengan

A.Office 3.0

What do you do if your computer dies/malfunctions? Reboot (Restart) Shut Down Recovery CD and Recover your system Call a person to fix it​

Answers

Answer:

Restart

Explanation:

Simply I may restart my pc if it dies/malfunctions. I'll not restart immediately, I'll wait for an hour and do restart my computer. If it doesn't work then maybe I'll Call a person to fix it.

Write a program that asks the user to enter in a username and then examines that username to make sure it complies with the rules above. Here's a sample running of the program - note that you want to keep prompting the user until they supply you with a valid username:

Answers

user_in = input ("Please enter your username: " )

if user_in in "0123456789":

print ("Username cannot contain numbers")

elif user_in in "?":

print ("Username cannot continue special character")

else:

print (" Welcome to your ghetto, {0}! ".format(user_in))

Other Questions
Im having a lot of trouble, can someone guide me, step by step? Porque crees que las personas llegan a consumir sustancias psicoactivas Help me please and thank you About lasiks eye surgery, Provide an example of changes over the years that may have prompted the public to opt for this procedure to correct their vision. if digoxin has a half life of 35 hours. how long will itake from a toxic level of 8ng/ml to 2 ng/ml Andrea created a picture of an aquarium, which she plans to give to her teacher to hang in the classroom. Andrea was very excited by the idea that her teacher would hang up her picture on the wall, especially since the reason Andrea had made it was to show her teacher she could draw all sorts of fish from memory. In which of Erikson's stages do children realize that they can obtain the recognition of teachers and parents by producing things A new site offers a subscription that costs 28.50 for 6 months.what is unit rate price per month? show ur work Have you any idea............ ? a. What is his name b. what his name is My friend prefers coffee C. what name tea AM and CMBM and BMAB and CB Which equation describes this graph? PLEASE HELP! Find an equation in standard form for the ellipse with the vertical major axis of length 16 and minor axis of length 10. PLS HELP 40 pointsIf you had the opportunity to fight against machismo, what would be some of the actions you would take to combat this social phenomenon? Select the statement that best justifies the conclusion based on the given information.a. Definition of bisector.b. Definition of midpoint.c. If two lines intersect, then their intersection is exactly one point.d. Through any two different points, exactly one line exists. The measures of two angles of a triangle are 36 degree and 75 degree . The length of the shortest side of a triangle is 10 cm . The length of longest side of the triangle is:? Sometimes people say silly things they do not intend to be mean.Identify the choice that corrects this run-on sentence. . Using the identity (a + b) = (a + 2ab + b), evaluate 112 Jesse travels 3.0 meters east and then turns and travels 4.0 meters north. The trip requires 35 seconds. What is his velocity? **25 POINTS**Which of the following lists of ordered pairs is a function? Graph the line that passes through (5, 5), and is perpendicular to a line whose slope is 2. Express as index formlog 2 64 = 6