Compound Boolean Expression Logic
A student qualifies for honors if they have a GPA of at least 3.5, and either an SAT score of at least 1400 or an ACT score of at least 32. The student’s data is stored in the variables gpa, sat, and act. Which of the following Java expressions correctly represents this condition?
A
gpa >= 3.5 && sat >= 1400 || act >= 32
B
gpa >= 3.5 && (sat >= 1400 || act >= 32)
C
(gpa >= 3.5 && sat >= 1400) || act >= 32
D
gpa >= 3.5 || (sat >= 1400 && act >= 32)
Question Leaderboard
Not enough data yet to show leaderboard.
