help debuging

hi . i am actually very proud of myself with this program because i didnt know i was able to do it. i only have one error it is.... line 194 expected `}' at end of input

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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#include <iostream>

using namespace std;

class setup{
    public:
           
    void title(){
         
    system("TITLE calculator");
    system("color 2");
    cout << "hello!!!, IM A CALCULATOR... lets get started" << endl << endl;
         }
};
    


int main()
{
    setup setapp1;
    setapp1.title();
    
    int howmany;
    double a;
    double b;
    double c;
    double d;
    double e;
    char cchar;
    char cagain;
    
    cout << "please enter the amount of numbers you want to use: ";
    cin >> howmany;
    
    switch (howmany){
           case 1:
                cout << "invalid number" << endl;
                break;
           case 2:
                do{
    
    cout << "please enter the first number you want to use" << endl;
    cin >> a;
    cout << "please enter the operation you would like to use" << endl;
    cin >> cchar;
    cout << "please enter the second number you would like to use" << endl;
    cin >> b;
    
    switch (cchar){
           
           case '+':
                cout << "the answer is: " << a << " + " << b << " = "
                << (a + b) << endl;
                break;
           case '-':
                cout << "the answer is: " << a << " - " << b << " = "
                << (a - b) << endl;
                break;
           case '*':
                cout << "the answer is: " << a << " * " << b << " = "
                << (a * b) << endl;
                break;
           case '/':
                cout << "the answer is: " << a << " / " << b << " = "
                << (a / b) << endl;
                break;
           default:
                cout << "you cant use that operation";
                break;
                }
                cout << "would you like to start again (y or n)";
           cin >> cagain;
           }while (cagain == 'y' || cagain == 'Y');
           break;
           
           case 3:
                do{
    cout << "please enter the operation you would like to use" << endl;
    cin >> cchar;
    cout << "please enter the first number you would like to use" << endl;
    cin >> a;
    cout << "please enter the second number you would like to use" << endl;
    cin >> b;
    cout << "please enter the third number you would like to use" << endl;
    cin >> c;
    
    switch (cchar){
           
           case '+':
                cout << "the answer is: " << a << " + " << b << "+" << c << " = "
                << (a + b + c) << endl;
                break;
           case '-':
                cout << "the answer is: " << a << " - " << b << "-" << c << " = "
                << (a - b - c) << endl;
                break;
           case '*':
                cout << "the answer is: " << a << " * " << b << " * " << c << " = "
                << (a * b * c) << endl;
                break;
           case '/':
                cout << "the answer is: " << a << " / " << b << " / " << c << " = "
                << (a / b / c) << endl;
                break;
           default:
                cout << "you cant use that operation";
                break;
                }
                cout << "would you like to start again (y or n)";
           cin >> cagain;
           }while (cagain == 'y' || cagain == 'Y');
           case 4:
                do{
    cout << "please enter the operation you would like to use" << endl;
    cin >> cchar;
    cout << "please enter the first number you would like to use" << endl;
    cin >> a;
    cout << "please enter the second number you would like to use" << endl;
    cin >> b;
    cout << "please enter the third number you would like to use" << endl;
    cin >> c;
    cout << "please enter the forth number you would like to use" << endl;
    cin >> d;
    
    switch (cchar){
           
           case '+':
                cout << "the answer is: " << a << " + " << b << "+" << c << "+" << d << " = " 
                << (a + b + c + d) << endl;
                break;
           case '-':
                cout << "the answer is: " << a << " - " << b << "-" << c << "-" << d << " = "
                << (a - b - c - d) << endl;
                break;
           case '*':
                cout << "the answer is: " << a << " * " << b << " * " << c << " * " << d << " = "
                << (a * b * c * d) << endl;
                break;
           case '/':
                cout << "the answer is: " << a << " / " << b << " / " << c << " / " << d << " = "
                << (a / b / c / d) << endl;
                break;
           default:
                cout << "you cant use that operation";
                break;
                }
                cout << "would you like to start again (y or n)";
           cin >> cagain;
           }while (cagain == 'y' || cagain == 'Y');
           case 5:
                do{
    cout << "please enter the operation you would like to use" << endl;
    cin >> cchar;
    cout << "please enter the first number you would like to use" << endl;
    cin >> a;
    cout << "please enter the second number you would like to use" << endl;
    cin >> b;
    cout << "please enter the third number you would like to use" << endl;
    cin >> c;
    cout << "please enter the forth number you would like to use" << endl;
    cin >> d;
    cout << "please enter the fifth number you would like to use" << endl;
    cin >> e;
    
    switch (cchar){
           
           case '+':
                cout << "the answer is: " << a << " + " << b << "+" << c << " + " << d << " + " << e << " = "
                << (a + b + c + d + e) << endl;
                break;
           case '-':
                cout << "the answer is: " << a << " - " << b << "-" << c << " - " << d << " - " << e << " = "
                << (a - b - c - d - e) << endl;
                break;
           case '*':
                cout << "the answer is: " << a << " * " << b << " * " << c << " * " << d << " * " << e << " = "
                << (a * b * c * d * e) << endl;
                break;
           case '/':
                cout << "the answer is: " << a << " / " << b << " / " << c << " / " << d << " / " << e << " = "
                << (a / b / c / d / e) << endl;
                break;
           default:
                cout << "you cant use that operation";
                break;
                }
                cout << "would you like to start again (y or n)";
           cin >> cagain;
           
           }while (cagain == 'y' || cagain == 'Y');
           
    system("pause");
    return 0;
}
    
                
           
           
   
You left out a close brace at line 191.
BTW, you're also missing the break statement right before case 4 and case 5.
Topic archived. No new replies allowed.