Quote:
PART 1) Add the appropriate Boolean expression to the while. The while loop should exit when a team has scored at least 15 points and is ahead by at least 2. That is, the loop exits when the score is 15 – 8 but not 15 -14. Remember that the Boolean expression should be the opposite of the exit condition. Hint: A good strategy in this case is to write a Boolean expression for the stopping condition and apply the NOT operator, !, to it. (PART 2) Also program should play multiple games, wins match at 5 game wins with a difference of at least two games.
For part one all you have to do is answer some questions: What Boolean expression is true when a team scores at least 15 points? What Boolean expression is true when a team leads by at least 2? What Boolean operator will ensure that both of these are true when the loop is exiting? The hint explains how to use these answers in the actual condition.