Need Help with a Bowling Score Program

This is a discussion on Need Help with a Bowling Score Program within the C++ Programming forums, part of the General Programming Boards category; Hey all, I am doing a Bowling Score program for my C++ class. Ive tried every peice of logic I ...

Need Help with a Bowling Score Program

Hey all, I am doing a Bowling Score program for my C++ class. Ive tried every peice of logic I know of, but cant get it to work still. Strikes and spares are whats giving me the problem. I can do everything else fine, its just those damn spikes and spares. Well, I am out of ideas and need help.

The program doesn't need to play bowling, it just asks you for your score, strikes, spares, and then makes the total pins knocked down, total strikes, and total spares, for the game. Any help would be appreciated!!

Advice: Clearly display your problem in english, I dunno about the others but I don't want to go through 100000 lines of code looking for something that I have no clue in what mile of the page it is on. Is this an algorithm problem? compile errors? if so, what are they?

>> We use Visual C++ 2003, so I don't use "using namespace std" and the like.

Visual C++ 2003 doesn't accept iostream.h, maybe you mean version 6.0? Also, just because you have an old compiler that works with old code doesn't mean it's a good idea use the old code that doesn't work on newer compilers. Many people here don't have old compilers and don't want to be bothered to fix your code to be standards compliant so that they can compile and run it and help you. Or, if you give a specific problem like durban mentioned, then we might not have to compile it to figure out the problem.

At first glance, your algorithm is all wrong. TO score bowling, you need to know each pin count in order from start to finish. If the first ball is 10, then it is a strike, otherwise if the first and second ball add up to ten, it is a spare. Try coming up with a better algorithm on paper before trying to implement it.