Here is the website for the assignment I am working on:
http://view.samurajdata.se/rsc/5c1dd0b4/
Here is the website for my header file (MixedExpression.h):
http://ideone.com/G9aC9D
Here is the website for my library source file (MixedExpression.cpp):
http://ideone.com/PfH8f0
Here is the website for my calculator client file (Calculator.cpp):
http://ideone.com/4wGayu
Here are the input lines:
( 1 + 2 / 6 ) + ( 3 + -3 / 9 )
( 3 + 5 / 9 ) + ( 2 + 3 / 7 )
( 7 + 5 / 25 ) + ( 4 + -6 / 14 )
( 3 + 5 / 9 ) - ( 2 + 3 / 7 )
( 3 + 5 / 9 ) / ( 2 + 3 / 7 )
( 7 + 5 / 25 ) * ( 4 + -6 / 14 )
( 4 + 4 / 5 ) * ( 2 + 3 / 6 )
Here is my output:
( 1 + 1 / 3 ) + ( 2 + 2 / 3 ) = ( 4 + 0 / 1 )
( 3 + 5 / 9 ) + ( 2 + 3 / 7 ) = ( 5 + 62 / 63 )
( 7 + 1 / 5 ) + ( 3 + 4 / 7 ) = ( 10 + 27 / 35 )
( 3 + 5 / 9 ) - ( 2 + 3 / 7 ) = ( 1 + 8 / 63 )
( 3 + 5 / 9 ) / ( 2 + 3 / 7 ) = ( 1 + 71 / 153 )
( 7 + 1 / 5 ) * ( 3 + 4 / 7 ) = ( 25 + 5 / 7 )
( 4 + 4 / 5 ) * ( 2 + 1 / 2 ) = ( 12 + 0 / 1 )
( 4 + 4 / 5 ) * ( 2 + 1 / 2 ) = ( 12 + 0 / 1 )
My question is: All of my code is correct, except the last line is printing twice. This is the only part I need help correcting. I know I should not use the eof() member function, but I'm not sure what else to use. How can I fix this small part?