Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I've been writing a calculator that shows all the steps in working out a sum. I've currently done showing the working out for "+", "-", "*" and "/". To do that I needed to get a parser to parse an equation (Ie. if I got 5+3+5+6*5+3*5/3" It would work through the sum giving me numbers I could deal with for showing the working out). Having done that, I want to add the ability to solve equations like "5X-2X^2+5-3=7X". In order to do that, I need an idea as to how to make such a parser (Even source code...). I tried one idea - I took out "X" with its Index and its exponent on the side containing "X" and sent the sum whch didn't contain "X" into the parser to return me a number and then "-"ssed "X" from it (Or "+"ssed, depending on the sum) and it returned me the answer. The problem with this was that I only managed to work out code to take out ONE "X" with its exponents.
If you have code, an idea or anything, pls reply.
0 · ·