1. ## Homework :)

Ia m not from the US or the UK or any other country that has English as their native language, so please forgive me if i made any grammar errors.

MY teacher gave me a task to do at home:
I need to create a simple calculator that does the basic stuff like + - * /, but it also has to repsect the order of calculation; for ex. if I type 2+3*5-5 it will first do the * and then the + & -. And it mustn't do the operations 1 by 1 as they are inputed, it has to do the entire equasion at once so it must allow the input of more numbers and operations until the user hits the button = and when the user hits the button = the calc gives out the solution. I hope u all understood me.

I kinda suck at programming so I'm asking any of you guys if you could help me in any way possible. I'm nopt asking for you to do the program for me i'm just asking if any1 had any ideas on how i could do this. but if any1 could find the spare time to write me the program i woul dbe forever grateful ))

2. Your teacher wants you to write expression parser?
You could use shunting yard algorithm.
If you are not good at programming, I could guess it would be hard for you.

>>but if any1 could find the spare time to write me the program i woul dbe forever grateful

3. I did this assignment about 3 weeks ago, are you using problem solving and program design using C and are in in Chapter 6? If so reading the chapters really helps, LOL.

Anyway, I created two functions, one to scan user input which returned a number and operator (used pointers) and another was a switch case to perform the operation using the operator chosen in the other function. The 2nd function returned the calculations to main to be displayed. Main was a do while loop that calls the other 2 functions as long as operator q and number 0 weren't selceted. There is an if/else statement in the do while loop that either displays the value so far and continues or displays the value and quits.

Good luck, I'm a newbie as well this one took me some time to get right and I had to ask a couple of questions here as well. However I always post my code so folks were glad to help.

4. Originally Posted by Bayint Naung
>>but if any1 could find the spare time to write me the program i woul dbe forever grateful
I'm sorry i didn't know there was a homework policy ill read it ASAP!

Originally Posted by dolfaniss
However I always post my code so folks were glad to help.
Thanks alot now I'm gonna get an A!

5. Originally Posted by boksanns94
I'm sorry i didn't know there was a homework policy ill read it ASAP!

Thanks alot now I'm gonna get an A!
OHHHH, you found it. I don't know if I posted the final product, don't remember but I'm sure it was close.