ExpressionEvaluator
Purpose
The purpose of this program is to take a string like series of numbers and operations (expression) and evaluate it using stacks. It should have the ability to take an expression such as 1+2*3 and calculate the result with consideration to order of operations. It should also be able to handle negative numbers, parenthesis, and implied multiplication.
Planning
The program will utilize two separate stacks, one containing numbers and the other operations, in order to maintain PEMDAS order of operations. For each token, there are three possibilities. If the current token is a number, add it to the data stack. If the token is an operation and the operation at the top of the operations stack is of higher precedence, then the program can execute the top operation. Otherwise, the current token will be added to the end of the operation stack.
Progress Reports
Progress Report 1
Passing 6/9 JUnit tests
Update 2
Passing 9/9 JUnit tests
Analysis/Summary
With this first ADEN project, I learned that many of the tools that I often take for granted, such as calculators, are actually built on extremely complex and well-optimized programs. Throughout my time as a hobbyist programmer and aspiring software developer, I've mostly worked with higher level programming languages such as Python and C++ which have numerous libraries built in that are able to drastically simplify code. However, these languages can't really be used in a device like a calculator which needs to be fast and power efficient. This can only be accomplished using a lower level language such as assembly, but also means that programmers have to create many of their own modules rather than relying on what the language already has built in. Overall, I've gained a lot of respect for the low-level programmers that have created the infrastructure that allows integrated systems to operate.