Calculator
STANDALONE DOWNLOAD
Note The source code is not available for this project.
I created this calculator for a university project. Although it lacks accuracy with very large numbers it can handle a surprising amount of abuse when it comes to the length and complexity of calculations. Obviously not as complete or able as other calculators out there (I’m looking at you Microsoft) but still a good attempt nonetheless.
Although this particular version of the calculator does not use the Reverse Polish Notation(RPN) algorithm, at one point it did. The reason I removed it is to see what kind of algorithm I could come up with on my own (and not because the files got corrupted and I had to start again). I think the algorithm I have created isn’t original, efficient or even comparable really but I still learned a lot from this project.
Given the choice to start over, I would make it an RPN based calculator. However, as it stands currently this version uses strings and markers in those string to calculate the equations fed to it one bit at a time.
For an example of how this program works take the sum:
10+(5*4)
The program would find the brackets first and isolate whatever is inside using a substring:
5*4
As there are only two digits in this new string it can now remove the operator and convert each number to a long double, calculate the equation, and reinsert the answer as a string into the original string:
10+20
So following this logic the answer would of course turn out to be 30. I have left the debug console visible with the application so if you’re interested you can see some of the logic that the program runs through.