I am building a 4 functions calculator program, it is accepting a number then at next line an Arithmetic Operator then at another line another number then show calculation on only single operator.
i need help to modify it to accept data like this
12 + 12 - 2 * 2 = 20 as wel or
100 / 2 + 200 = 250 i mean it have to perform calculation from all four operators on single line or two or three
here is a program which is getting input like this
that i don't want.
i shall wait for you answers !
if you have an example code for this pupose send me i will study from that.
Sorry but we are NotACodeMill. If you really did that code, you could easily do what you want just by looking at Scanner and String documentations.
Joined: Jun 11, 2009
Eduardo Bueno wrote:Sorry but we are NotACodeMill. If you really did that code, you could easily do what you want just by looking at Scanner and String documentations.
I know sir you are not a code mil,
i don't say that correct it as i say, i say that provide me sample which could work like that i shall study on that and after that i shall use that code in my program, you say that use Scanner and String documentation i will follow that now i shall study on those .
You could implement a stack data structure to your program for the operands and the operators including the "(" ")" parenthesis. It would be simpler to evaluate a postfix expression than to an infix expression.