If you would like to get into the advanced part of calculator building, that uses order of operations to evaluate expressions, look up Reverse Polish Notation, which is done using the Shunting-yard Algorithm.