Consider the following variable declarations and initializations.
int a = 2;
int b = 6;
int c = 3;
Which of the following expressions evaluates to false ?
AP Comp Sci A MidTerm Review
Quiz
•
Other
•
9th - 12th Grade
•
Hard
Laura Frauenberg
Used 2+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following variable declarations and initializations.
int a = 2;
int b = 6;
int c = 3;
Which of the following expressions evaluates to false ?
a < b == c < b
a > b == b < c
a < b != b < c
a < b != c < b
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
boolean a = true;
boolean b = false;
System.out.print((a == !b) != false);
What is printed as a result of executing this code segment?
false
true
0
1
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following expression.
(3 + 4 == 5) != (3 + 4 >= 5)
What value, if any, does the expression evaluate to?
true
false
5
7
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
int m = 8;
int n = 3;
if (m + n > 10)
{
System.out.print(m + n);
}
if (m - n > 0)
{
System.out.print(m - n);
}
What, if anything, is printed as a result of executing the code segment?
nothing is printed
115
11
5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code segment.
boolean a = true;
boolean b = true;
System.out.print((b || (!a || b)) + " ");
System.out.print(((!b || !a) && a) + " ");
System.out.println(!(a && b) && b);
What output is produced when this code segment is executed?
true true true
true false true
true false false
false true false
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following expression, j, k, and m are properly declared and initialized int variables.
!((j == k) && (k > m))
Which of the following is equivalent to the expression above?
(j != k) || (k < m)
(j != k) || (k <= m)
(j == k) || (k < m)
(j != k) && (k <= m)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the following expression, sunny and windy are properly declared and initialized boolean variables.
!sunny && !windy
Which of the following is equivalent to the expression above?
sunny || windy
!sunny || !windy
!(sunny || windy)
!(sunny && windy)
20 questions
Examen de JavaScript
Quiz
•
12th Grade
20 questions
Java Basics Quiz
Quiz
•
12th Grade
20 questions
Arrays
Quiz
•
9th - 12th Grade
20 questions
Latihan Bahasa Pemrograman C ++
Quiz
•
10th Grade
22 questions
Funções e Estruturas em Programação C - Parte I
Quiz
•
9th Grade - Professio...
20 questions
Robotics 10
Quiz
•
10th Grade
21 questions
Java quiz
Quiz
•
11th Grade
20 questions
Primitive Types
Quiz
•
10th Grade - University
15 questions
Multiplication Facts
Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz
Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
15 questions
June Review Quiz
Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles
Quiz
•
8th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade
40 questions
Week 4 Student In Class Practice Set
Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025
Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)
Quiz
•
9th - 12th Grade
25 questions
Triangle Inequalities
Quiz
•
10th - 12th Grade
10 questions
Right Triangles: Pythagorean Theorem and Trig
Quiz
•
11th Grade
46 questions
Biology Semester 1 Review
Quiz
•
10th Grade
24 questions
LSO - Virus, Bacteria, Classification - sol review 2025
Quiz
•
9th Grade
65 questions
MegaQuiz v2 2025
Quiz
•
9th - 12th Grade