Answer to Question #81593 in C++ for David

Question #81593
// Continue playing as long as the game is not over
// (a team does not have a score of 15 or more
// with a difference of at least 2)

while (!((buffstate >= 15 || notredame >= 15) && (buffstate - notredame <= 2 || notredame - buffstate >= 2)))
Im not sure if my boolean expression is correct? The program executes, however its not following the (difference of at least 2 for the score)
1
Expert's answer
2018-10-03T05:07:57-0400
correct boolean expression: ((buffstate >= 15 || notredame >= 15) && (buffstate - notredame <= 2 || notredame - buffstate <= 2)) || ( buffstate <= 15 || notredame <= 15)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS