I am going crazy with my code...but I can not find why the program is not calculating the average score at the end of the program. It is suppose to work where at the end of the program it take the number of diver input and divide it by the overallScore.
thanks for the tips, i just started and the lab i had to do said i had to use a Do-While but in reality i heard a While loop is way better and no one really uses do-while statements...that's why i used a GOTO.
I understand and read somewhere that goto should never be used.
but i still dont know why this code won't work
1 2 3 4 5 6
//----------Summary of events
cout << "\nNumber of divers participating: " << totalDivers << endl;
overAllNumbers = (totalAverage / totalDivers);
cout << "Average score of all divers: " << overAllNumbers << endl;
Line 116: Should this be an if statement? The value of mainLoopNo isn't changed inside the loop, also it suffers from the same logic error mentioned above, making it always false. If you change that, and the program works, don't be tempted to leave the rest of the code as it is.
Have you made any changes to the code that I mentioned earlier? Your teacher will probably mark you down for using goto. All of your goto's could be fixed with while loops. If I was the teacher, I would give more marks for clear, elegant code. 50% even, so if it works, but is hard to read & un-organised - then you would get half marks.
Was a do loop specifically asked for, or was it just a suggestion? As I said earlier, a for loop would be better than your current do loop.