Assume the following variables have been declared and given values elsewhere:
boolean isFelon;
int age;
A person may vote if they are 18 or older and not a felon.Which of the following statements assigns the Boolean variable mayVote correctly?
A) mayVote = (age >= 18) || !isFelon;
B) mayVote = !((age >= 18) && isFelon) ;
C) mayVote = (age >= 18) && !isFelon;
D) mayVote = !((age >= 18) || isFelon) ;
Correct Answer:
Verified
Q109: Which of the following options checks that
Q110: Which of the following conditions tests for
Q111: Which of the following options checks that
Q112: Assume isBusy and isHappy have been defined
Q113: Assuming that a user enters 68 as
Q114: Assume isBusy has been defined to be
Q115: Assume isBusy has been defined to be
Q116: Which of the following expressions represents a
Q117: Consider the following code snippet:
Q118: Assume a, b, and c have been
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents