my ever first C++ program.. I dont know whats wrong

i,m working with a "inventory" system here but it seems i cannot find whats wrong.. a help is greatly appreciated.. thanks!

#include<iostream.h>
#include<math.h>
#include<string>

using namespace std;


int main();


{
do
{


int dec, a, na, nb, nc, nd, ne, nf, ng, nh, ni, nj;
int ina, inb, inc, ind, ine, inf, ing, inh, ini, inj;
int record#;
char deca;



{
if((deca=='Y'||deca=='y')&&record#=='13')
ina=na;
else
ina=18;


if((deca=='Y'||deca=='y')&&record#=='19')
inb=nb;
else
inb=12;


if((deca=='Y'||deca=='y')&&record#=='26')
inc=nc;
else
inc=16;


if((deca=='Y'||deca=='y')&&record#=='39')
ind=nd;
else
ind=10;


if((deca=='Y'||deca=='y')&&record#=='56')
ine=ne;
else
ine=8;


if((deca=='Y'||deca=='y')&&record#=='76')
inf=nf;
else
inf=236;


if((deca=='Y'||deca=='y')&&record#=='81')
ing=ng;
else
ing=32;


if((deca=='Y'||deca=='y')&&record#=='88')
inh=nh;
else
inh=65;


if((deca=='Y'||deca=='y')&&record#=='69')
ini=ni;
else
ini=25;


if((deca=='Y'||deca=='y')&&record#=='12')
inj=nj;
else
inj=40;
}
cout<<"**********************INVENTORY****************************"<<"\n";
cout<<"RECORD# TOOL NAME QUANTITY COSTperITEM"<<"\n";
cout<<" 13 sander "<<ina<<" $35.99"<<"\n";
cout<<" 19 hammer "<<inb<<" $10.00"<<"\n";
cout<<" 26 jigsaw "<<inc<<" $14.25"<<"\n";
cout<<" 39 mower "<<ind<<" $79.50"<<"\n";
cout<<" 56 saw "<<ine<<" $89.99"<<"\n";
cout<<" 76 screwdriver "<<inf<<" $04.99"<<"\n";
cout<<" 81 sledgehammer "<<ing<<" $19.75"<<"\n";
cout<<" 88 wrench "<<inh<<" $06.48"<<"\n";
cout<<" 69 mallet "<<ini<<" $85.60"<<"\n";
cout<<" 12 shovel "<<inj<<" $92.40"<<"\n";
cout<<"***********************************************************"<<"\n";
cout<<"\n";
cout<<"\n";


cout<<"Please enter the item's RECORD NUMBER:"<<"\n";
cin>>record#;
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";

if(record#=='13')
{
cout<<"You have keyed-in RECORD# 13 for item SANDER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
na=18+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
na=18-a;

}

// b****
else if(record#=='19')
{
cout<<"You have keyed-in RECORD# 19 for item HAMMER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nb=12+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nb=12-a;
}
//c****
else if(record#=='26')
{
cout<<"You have keyed-in RECORD# 26 for item JIGSAW"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nc=16+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nc=16-a;
}
//d***
else if(record#=='39')
{
cout<<"You have keyed-in RECORD# 39 for item MOWER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nd=10+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nd=10-a;
}
//e*********
else if(record#=='56')
{
cout<<"You have keyed-in RECORD# 56 for item SAW"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
ne=8+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
ne=8-a;
}
//f****
else if(record#=='76')
{
cout<<"You have keyed-in RECORD# 76 for item SCREWDRIVER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nf=236+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nf=236-a;
}
//g******
else if(record#=='81')
{
cout<<"You have keyed-in RECORD# 81 for item SLEDGEHAMMER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
ng=32+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
ng=32-a;
}
//h******
else if(record#=='88')
{
cout<<"You have keyed-in RECORD# 88 for item WRENCH"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nh=65+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nh=65-a;
}
//i**********
else if(record#=='69')
{
cout<<"You have keyed-in RECORD# 69 for item MALLET"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
ni=25+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
ni=25-a;
}
//j****
else if(record#=='12')
{
cout<<"You have keyed-in RECORD# 12 for item SHOVEL"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if (dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nj=40+a;

else if (dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nj=40-a;
}
cout<<"Do you still wish to do changes in the inventory? [Y/N]"<<"\n";
cin>>deca;
}
while(deca=='Y'||deca=='y');


return 0;
}
Error message/code tags pl0x
can u fix it? i really dont know what to do then.. sigh
[code]
#include <iostream>

int main(){
std::cout <<"Hello, World!"<<std::endl;
return 0;
}
[/code]
becomes
1
2
3
4
5
6
#include <iostream>

int main(){
    std::cout <<"Hello, World!"<<std::endl;
    return 0;
}



For people who answer more than they ask, here's the BBScode that generates the above:
[co[b][/b]de]
#include <iostream>

int main(){
[tt] [/tt]std::cout <<"Hello, World!"<<std::endl;
[tt] [/tt]return 0;
}
[/code]
becomes
[code]
#include <iostream>

int main(){
std::cout <<"Hello, World!"<<std::endl;
return 0;
}
[/code]


Please don't ask for what generated that. It's like Quine minus the fun factor.
Last edited on
What is your error message.
As Helios said:
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
#include<iostream.h>
#include<math.h>
#include<string>

using namespace std;


int main();


{
do
{


int dec, a, na, nb, nc, nd, ne, nf, ng, nh, ni, nj;
int ina, inb, inc, ind, ine, inf, ing, inh, ini, inj;
int record#;
char deca;



{ 
if((deca=='Y'||deca=='y')&&record#=='13')
ina=na;
else
ina=18;


if((deca=='Y'||deca=='y')&&record#=='19')
inb=nb;
else
inb=12;


if((deca=='Y'||deca=='y')&&record#=='26')
inc=nc;
else
inc=16;


if((deca=='Y'||deca=='y')&&record#=='39')
ind=nd;
else
ind=10;


if((deca=='Y'||deca=='y')&&record#=='56')
ine=ne;
else
ine=8;


if((deca=='Y'||deca=='y')&&record#=='76')
inf=nf;
else 
inf=236;


if((deca=='Y'||deca=='y')&&record#=='81')
ing=ng;
else
ing=32;


if((deca=='Y'||deca=='y')&&record#=='88')
inh=nh;
else 
inh=65;


if((deca=='Y'||deca=='y')&&record#=='69')
ini=ni;
else
ini=25;


if((deca=='Y'||deca=='y')&&record#=='12')
inj=nj;
else
inj=40;
} 
cout<<"**********************INVENTORY****************************"<<"\n";
cout<<"RECORD# TOOL NAME QUANTITY COSTperITEM"<<"\n";
cout<<" 13 sander "<<ina<<" $35.99"<<"\n";
cout<<" 19 hammer "<<inb<<" $10.00"<<"\n";
cout<<" 26 jigsaw "<<inc<<" $14.25"<<"\n";
cout<<" 39 mower "<<ind<<" $79.50"<<"\n";
cout<<" 56 saw "<<ine<<" $89.99"<<"\n";
cout<<" 76 screwdriver "<<inf<<" $04.99"<<"\n";
cout<<" 81 sledgehammer "<<ing<<" $19.75"<<"\n";
cout<<" 88 wrench "<<inh<<" $06.48"<<"\n";
cout<<" 69 mallet "<<ini<<" $85.60"<<"\n";
cout<<" 12 shovel "<<inj<<" $92.40"<<"\n";
cout<<"***********************************************************"<<"\n";
cout<<"\n";
cout<<"\n";


cout<<"Please enter the item's RECORD NUMBER:"<<"\n";
cin>>record#;
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";
cout<<"\n";

if(record#=='13')
{
cout<<"You have keyed-in RECORD# 13 for item SANDER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
na=18+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
na=18-a;

}

// b****
else if(record#=='19') 
{
cout<<"You have keyed-in RECORD# 19 for item HAMMER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nb=12+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nb=12-a;
}
//c****
else if(record#=='26')
{
cout<<"You have keyed-in RECORD# 26 for item JIGSAW"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nc=16+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nc=16-a;
}
//d***
else if(record#=='39')
{
cout<<"You have keyed-in RECORD# 39 for item MOWER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nd=10+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nd=10-a;
}
//e*********
else if(record#=='56')
{
cout<<"You have keyed-in RECORD# 56 for item SAW"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
ne=8+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
ne=8-a;
}
//f****
else if(record#=='76')
{
cout<<"You have keyed-in RECORD# 76 for item SCREWDRIVER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nf=236+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nf=236-a;
}
//g******
else if(record#=='81')
{
cout<<"You have keyed-in RECORD# 81 for item SLEDGEHAMMER"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
ng=32+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
ng=32-a;
}
//h******
else if(record#=='88')
{
cout<<"You have keyed-in RECORD# 88 for item WRENCH"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nh=65+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nh=65-a;
}
//i**********
else if(record#=='69')
{
cout<<"You have keyed-in RECORD# 69 for item MALLET"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if(dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
ni=25+a;

else if(dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
ni=25-a;
}
//j****
else if(record#=='12')
{
cout<<"You have keyed-in RECORD# 12 for item SHOVEL"<<"\n";
cout<<"Key-in: [1] to add item count"<<"\n";
cout<<" [2] to subtract item count"<<"\n";
cin>>dec;

if (dec==1)

cout<<"How many pieces to ADD?"<<"\n";
cin>>a;
nj=40+a;

else if (dec==2)

cout<<"How many pieces to SUBTRACT?"<<"\n";
cin>>a;
nj=40-a;
}
cout<<"Do you still wish to do changes in the inventory? [Y/N]"<<"\n";
cin>>deca;
}
while(deca=='Y'||deca=='y');


return 0;
}


Please post your error message.
HOLY IF STATMENTS, well your not even intalizing your deca or any other variable before they are used , then your trying to compare it to a condition. Plus your trying to compare your record# with a char '', Its kinda of a mess
holy cow! how bad am i doing this?!! hehe.. can anyone fix this..
its like this:

i'm workin on a program - an inventory system, simply is tasked to add or subtract quantities from given fixed items with fixed prices until the user decides to stop doing so.. until then the program will prompt/display a final listing/output of the items after it has been added or subtracted..

my problem is that i dont know how to fit-in the "record#"-where the record# of each assigned item in the inventory, will serve as the "ID".. the user will key-in the record# if he/she wishes to add/subtract from that item..

can someone help me here? :(
i think i got it!

#include<iostream>
#include<string>
using namespace std;

int Qty[10];
double Price[10];
int menu;
int ProNo;
int x;





void tool1()
{
Price[1]=35.99;
cout<<"\n13 Sander "<<Qty[1]<<" "<<Price[1]<<" "<<Qty[1]*Price[1]<<"\n";
}
void tool2()
{
Price[2]=10;
cout<<"\n19 Hammer "<<Qty[2]<<" "<<Price[2]<<" "<<Qty[2]*Price[2]<<"\n";
}
void tool3()
{
Price[3]=14.25;
cout<<"\n26 Jigsaw "<<Qty[3]<<" "<<Price[3]<<" "<<Qty[2]*Price[3]<<"\n";
}
void tool4()
{
Price[4]=79.50;
cout<<"\n39 Mower "<<Qty[4]<<" "<<Price[4]<<" "<<Qty[3]*Price[4]<<"\n";
}
void tool5()
{
Price[5]=89.99;
cout<<"\n56 Saw "<<Qty[5]<<" "<<Price[5]<<" "<<Qty[4]*Price[5]<<"\n";
}
void tool6()
{
Price[6]=4.99;
cout<<"\n76 Screwdriver "<<Qty[6]<<" "<<Price[6]<<" "<<Qty[5]*Price[6]<<"\n";
}
void tool7()
{
Price[7]=19.75;
cout<<"\n81 Sledgehammer "<<Qty[7]<<" "<<Price[7]<<" "<<Qty[6]*Price[7]<<"\n";
}
void tool8()
{
Price[8]=6.48;
cout<<"\n88 Wrench "<<Qty[8]<<" "<<Price[8]<<" "<<Qty[7]*Price[8]<<"\n";
}
void tool9()
{
Price[9]=85.6;
cout<<"\n69 Mallet "<<Qty[9]<<" "<<Price[9]<<" "<<Qty[8]*Price[9]<<"\n";
}
void tool10()
{
Price[10]=92.4;
cout<<"\n12 Shovel "<<Qty[10]<<" "<<Price[10]<<" "<<Qty[9]*Price[10]<<"\n";
}



int main()
{

cout<<"**********************INVENTORY****************************"<<"\n";
cout<<"RECORD# TOOL NAME INITIAL QUANTITY COSTperITEM"<<"\n";
cout<<"13 sander 18 $35.99\n";
cout<<"19 hammer 12 $10.00\n";
cout<<"26 jigsaw 16 $14.25\n";
cout<<"39 mower 10 $79.50\n";
cout<<"56 saw 8 $89.99\n";
cout<<"76 screwdriver 236 $04.99\n";
cout<<"81 sledgehammer 32 $19.75\n";
cout<<"88 wrench 65 $06.48\n";
cout<<"69 mallet 100 $85.60\n";
cout<<"12 shovel 50 $92.40\n";
cout<<"***********************************************************"<<"\n";

while(1)
{
cout<<"No. Description Qty Price Total";

tool1();
tool2();
tool3();
tool4();
tool5();
tool6();
tool7();
tool8();
tool9();
tool10();


cout<<"Enter Product No.:";
cin>>ProNo;

if(ProNo==13)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[1]=x;
tool1();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[1]=Qty[1]-x;
tool1();
}
}
else if(ProNo==19)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[2]=x;
tool2();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[2]=Qty[2]-x;
tool2();
}
}
else if(ProNo==26)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[3]=x;
tool3();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[3]=Qty[3]-x;
tool3();
}
}
else if(ProNo==39)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[4]=x;
tool4();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[4]=Qty[4]-x;
tool4();
}
}
else if(ProNo==56)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[5]=x;
tool5();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[5]=Qty[5]-x;
tool5();
}
}
else if(ProNo==76)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[6]=x;
tool6();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[6]=Qty[6]-x;
tool6();
}
}
else if(ProNo==81)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[7]=x;
tool7();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[7]=Qty[7]-x;
tool7();
}
}
else if(ProNo==88)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[8]=x;
tool8();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[8]=Qty[8]-x;
tool8();
}
}
else if(ProNo==69)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[9]=x;
tool9();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[9]=Qty[9]-x;
tool9();
}
}
else if(ProNo==12)
{
cout<<"Enter [1]to ADD or [2]to SUBTRACT";
cin>>menu;

if(menu==1)
{
cout<<"Enter Qty to ADD:";
cin>>x;
Qty[10]=x;
tool10();
}
else if(menu==2)
{
cout<<"Enter Qty to SUBTRACT:";
cin>>x;
Qty[10]=Qty[10]-x;
tool10();
}
}

system("cls");
}

return 0;
}
[code] Please put your code between code tags [/code]
You should try creating a int function() that will accept all values so you dont have a bunch of void functions that are basciacally doing the same thing
You should also post the simplest possible example that conveys the problem/situation. For example, just have 2 cases instead of 3094 lol.
Okay, this would probably be alot easier if you used classes, although I suppose they might be above you level.
I suppose [classes] might be above you level.

That shouldn't be the case. Novices should be taught classes from the very beginning. If you're learning C++ you're learning C++, not C, so why teach the "C with cout" style we see so much?
I like classes. They're not that difficult.
Well, tbh i think that it is hard to understand classes unless you already have an understanding of variable types, functions and scopes etc.
Topic archived. No new replies allowed.