Essentially, to be able to make calculations based on something like this:
you'll have to parse the user's input to basically separate the numbers from the operators and translate them into something that your program can calculate an output for. You'll want to find tutorials about
parsing/splitting strings for this. The amount of work for this really depends on how interpretive of human typing you want your calculator to be. Like, are these: 9 (1 + 6) and 9(1+6) valid inputs ? or will only this one work: 9*(1+6) ?
To start with, instead of using an integer like
you would start with accepting a full string as an input. Try it with the simplest case first like accepting only
2+3
from from the user into a string and then parse it and calculate then print the output " = 5".
Then eventually u could expand it to accept an arbitrary number of operations on the same line: 3/4 +6(1/4+2^3) - sqrt(4/(2pi))
As far as adding more operations to your calculator there's lots ! Like square root, exponents, logarithms, factorials, combinations/permutations - maybe even a prime number detector/factor'er'