# Thread: Desperate to get help w/ program

1. ## Desperate to get help w/ program

I'm not asking anyone to do my homework but I am desperate to get help. I need a huge boost in the right direction. My program is to calculate the value of an expression involving arithmetic operators. The expression should be evaluated based on operator precedence. The program should prompt the user to input the expression and should indicate the end of the expression by inputting a character E. The expression should have only numeric values and operators to add, subtract, multiply, and divide.

-The program should prompt the user to input only integer values
-the program should be written for integer values in the expression
-Arrays should be used to store the input values of the user
-Output of the program should be an integer value
-Functions can be used if necessary
here is an example that a user might enter
"34*2-8+6/3E"
the program should display the correct answer and the numbers stored as integers and the operators stored as char. Please someone help me out anyway you can. Thank you.

2. Are parentheses allowed? Like:

(1+2)/3E

?

Is whitespace valid? So, would:
Code:
`1        + 4/    2        E`
be valid?

Also, are there limits to the maximum number of numbers/operators?

How much have you learned? These problems can be solved with a stack, but I don't know if you've learned about that. You can also use recursion to solve this.

3. no recursion is NOT allowed, yes white spaces can be used and the maximum will be around 500 integers or so, depending on what i want it to be. and no pointers allowed either.

4. Is the use of parenthesis allowed? Without recursion, this is much more difficult. Parenthesis processing is way easier with recursion. You can of course, fake recursion, using a loop. This isn't nearly as clean to read, but it can be done.

Quzah.

5. we can also right the program so it goes like this:
34
*
2
+
5
E
and then it produces the answer
is that easier than the way i said before?
Thank you.

6. the way i just said, the:
34
*
2
etc......
i mean by that the user types in a number, hits return, enters an operation, then another number and so on.