Jan 4, 2011 at 5:46pm
Use a loop and sum all the values yourself.
You might also use some of the STL stuff from functional, but that's probably a bit advanced for this stage.
Jan 4, 2011 at 6:21pm
Just as a matter of curiosity, who taught you all those DOS commands ("pause", "cls", and "title")? Bane of secure programming, they are.
Jan 4, 2011 at 7:54pm
Try reading the errors. They tell you what's wrong with the code.
If you don't understand them, post them here and we can explain them.
Last edited on Jan 4, 2011 at 7:54pm
Jan 4, 2011 at 7:56pm
There's a small but important error on line 42. Moneysaved is using the wrong variable.
Edit: variable b on line 18 isn't declared.
Last edited on Jan 4, 2011 at 7:59pm
Jan 4, 2011 at 7:57pm
for (x=='n' || x=='N')
should be:
if (x=='n' || x=='N')
AND
for (int y=0; y=<moneysaved.size(); y++)
should be:
for (int y=0; y<=moneysaved.size(); y++)
Also, you have dropped your declaration of b. That should do it.
Jan 4, 2011 at 9:03pm
why moneysaved is using wrong variable?
int i = stands for what is stored in the vector... :s