Solved

Assume the Following Variables Have Been Declared and Given Values

Question 119

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents