Calculator Lab --------------------------------------------------------------------
You are to build a four-function calculator that works as follows:
Use either a JOptionPane or EasyReader to input a line of text containing
an expression with no spaces.
(Assume no parentheses or exponents)
Using the correct order of operations, calculate the value of the expression.
It should allow for any length input, but you can safely assume it will be entered
correctly.
EXAMPLE:
INPUT: 5+4*3/2 - 1
OUTPUT: 10
EXTRA CREDIT
Allow for the use for parentheses. Assume they are entered correctly.
MORE EXTRA CREDIT
- Make your program is robust in terms of parentheses. Determine if there
are a correct number of them (ie. same number of open and closed parentheses.)
EVEN MORE EXTRA CREDIT
- Allow your program to calculate exponents as well, using the "^#"
format
COUNTLESS ADDITIONAL EXTRA CREDIT
- Make your program capable of using the variable "a" in arithmetic.
- In other words, your program should be able to work in a single variable.
- ***Slight alternative***
- Have your program take an input in one variable, then a value for that
variable, and calculate the value of expression