Solved

Assume the Following Variables Have Been Declared and Given Values

Question 108

Multiple Choice

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:

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