Assume the following variables have been declared and given values elsewhere:
boolean completedProject;
int programsDone;
double classPercentage;
A student will pass programming class if and only if they have a percentage of 70.0% or higher and have either completed the project or they have done 5 or more programs.Which of the following statements assigns the Boolean variable passProgramming correctly?
A) passProgramming = (classPercentage >= 0.7) && (programsDone >= 5 || completedProject) ;
B) passProgramming = (classPercentage >= 0.7) && (programsDone >= 5) && (completedProject) ;
C) passProgramming = (classPercentage >= 0.7) || (programsDone >= 5) || (completedProject) ;
D) passProgramming = ((classPercentage >= 0.7) && (programsDone >= 5 ) ) || completedProject;
Correct Answer:
Verified
Q103: Assuming that a valid price should be
Q104: Which of the following statements can be
Q105: Assuming that a user enters 45, 78,
Q106: Which of the following performs the same
Q107: Which of the following options checks that
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
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