I'm creating a program that has four games. Each game will have two team. In each game, there would be 3 rounds. Should there be a tie, there would be round 4 where the first team to get 10 points will be the winner.
this is my code:
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
1) I don't see any games to play.
2) Can the team names change for each game? If not, then prompting for the team names should be outside your loop.
3) If a game is a tie, you declare "NO WINNER" instead of playing another round.
Should there be a tie, there would be round 4 where the first team to get 10 points will be the winner
As the points are entered and not obtained from play, this is pretty meaningless. What if points entered for both teams are both the same and at least 10? That is a draw again. What if both points entered are less than 10?
Wouldn't it be better to have additional rounds until there is a round winner?
As a first refactor, consider something like this which has extra rounds following round 3 if a draw until there is a winner. Note that it ignore the 'at least 10 points' criteria for the extra round(s) and just goes on a straight win: