I'm trying to write a program that, you tell it what you want, and it removes one from the quantity. It's compiling just fine and it even sends back the fail message I set up but it won't replace the number I want it to. I'm not allowed to modify the text file in any way.
Here's the contents of the text file:
Drink Name Cost Number in Machine
Cola $0.75 20
Root Beer $0.75 0
Lemon-Lime $0.75 20
Grape Soda $0.80 20
Cream Soda $0.80 20
this is somewhat confusing to read but it sure looks suspect to see:
for(;twentyThree<=100;)
{
...
getprice++;
mabob[getprice].price;
and similar logic.
I would almost bet money that you increment past 5 in there somewhere. If it is crashing, I would check that.
That aside, what exactly did not update as expected? What did you input? How far into the program did it get "correctly"? Youll want to put some debugging print statements in there, trace the logic, and see where it went wrong.