Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

I need to take 2 numbers and store it with some kind of flag value so that we know what math operation to execute on it.

I need help I don't know how to accomplish this any help would be great. I need to take 2 numbers and store it with some kind of flag value so that we know what math operation to execute on it. That flag value doesn't have to be something that is typed in with the numbers, so no need for parsing, we can use the menu selection to make this flag. These 2 numbers entered and stored have nothing to do with any other numbers being stored. Finally, the menu should have an option to run the math operations on the stored number pairs using that operation flag when ready, then pause and end the application. Does this sound about right?

I will assume that a simple output of the following would be ok once the math operations have been ran:

1 + 1 = 2

5 * 5 = 25

Of course, all of this has to be done in classes while demonstrating inheritance. I do have one question, are we required to store the numbers in the array/container as a numeric type or could we store them as their respective class 'type' and then make use of polymorphism to run the final operations? Done this way, we wouldn't need to use any kind of flag value, the type would act as its own flag and since we are overriding the calculations function, this would work nicely.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question