C++ complex calculator(HELP!)

i used this code for my c++ calculator..
but i need a complex one..
it can only perform 1 operation..
if you input 1+1*8 or (1+1)*8 it only computes 1+1..
i need a program that can perform 4 operations..
for example:
(((1+1)*1)-1)-(1/1)
any help here please?
thanks
here's the code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>

using namespace std;

int main()
{
int tal1, tal2, tal3;
char lol;
int val;
  cout<<" Pick a number"<<endl;
  cout<<" 1. RUN THE CALCULATOR"<<endl<<" 2. EXIT THE PROGRAM"<<endl<<endl<<endl;
  cin >> val;
 switch(val)
 case 1:
  {


cout << endl<<" ENTER YOUR EQUATION " << endl << endl;
cout << " ADD(+), SUBTRACT(-), DIVIDE(/) and  MULTIPLY(*)"<<endl<<endl;
cout << " Example :  3 + 3 " << endl << endl;
cout << " P.S. use only one operation" << endl << endl;
cin >> tal1 >> lol >> tal2;
switch(lol)
{
            case '+':
                 tal3 = tal1 + tal2;
                cout <<"="<<endl<<tal3;
                 break;
            case '-':
                 tal3 = tal1 - tal2;
                 cout <<"="<<endl<<tal3;
                 break;
            case '/':
                 tal3 = tal1 / tal2;
                 cout <<"="<<endl<<tal3;
                 break;     
            case '*':
                 tal3 = tal1 * tal2;
                 cout <<"="<<endl<<tal3;
                 break;     
                
          default: 
          cout << " Wrong  Command!";       
                 
        case 2:{

return 0;
}         

        break;         
                 }


cout << endl;
}

 






system("pause");
return 0;
}

Sure, here you go:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <string>
#include <parser>
using namespace std;

int main()
{
    string input;
    getline(cin, input);

    double ans = parseEquation(input);
    cout << ans << endl;

    return 0;
}


Obviously the above doesn't work. No one is going to give you full solutions, you need to actually try it yourself, and ask for help on specific questions if you get stuck.
thanks..ill try it now..^^
Topic archived. No new replies allowed.