This is the pastebin for my code:

http://pastebin.com/gV01kTje
Basically I have an assignment where I need to create a calculator capable of up to 3 step equations and being able to do all PEMDAS operations in PEMDAS order. So far I've gotten it up to 3 step operations and being able to do addition, subtraction, multiplication, and division in PEMDAS order, but I don't know where I would even start with trying to implement parentheses and exponents into my code. Can someone ease help me out?

Is it easier to ignore the "3 step" requirement and solve calculations of ANY length?

Can the program be subdivided into reusable parts?

(1) get a string from the user

(2) parse the string into an array of operators and numbers (aka tokenization)

(3) convert the array into postfix form (see shunting yard algorithm) to remove parentheses and simplify calculation

(4) perform the operations

(5) print the result

This is a common task, so are (2) and (3) already in the library? (4) is fairly simple, it needs one loop and a stack.

Exponents are explained in the shunting algorithm.