Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

I made a calculator program but I'm required to include inheritance and composition, stack/queue/linked list and operator overloading or template

OpenStudy (anonymous):

OpenStudy (anonymous):

make it work for variable number of input (not only two numbers) using linked lists, don't define the numbers as float but create a template based class number and sub classes which will inherit the basic one, overloaded operators for every kind of operation.It is chaos i know, but as you start programming it won't look that difficult..Good luck

OpenStudy (anonymous):

thanks @infinity_ , how would I set up the statement for variable number of input? like var x var y ? I you could type an example it would help, thanks again

OpenStudy (anonymous):

you can either implement a linked list, or knowing the operation, keep each number in one variable, and perform *=,+=,-=,/= in an other..in the end you just output the other variable

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!