Unit 3 AP Computer Science Practice Exam
Unit 3 AP Computer Science Practice Exam
1) Determine the output of the 4) The ==, !=, >, <, >=, and <=
following code: operators are?
(A) I only
(B) II only
(C) I and II
(D) II and III
(E) I, II, and III
(A) 1
(B) 2
(C) 3
(A) “B” (D) 4
(B) “C” (E) 5
(C) “D”
(D) “F”
This practice test was created by Ajay Gandecha.
This test and I are not affiliated with, or endorsed by, the College Board.
No questions are copied from the College Board and were made on my own for you to prepare.
Good luck!
12) Determine the output of the 15) What program best represents the
following code: control flow diagram below?
(A) x = 8;
(B) if (x > 3) x *= 4; (B)
(C) if (x > 3) x = 8;
(D) if (x > 3) x=8; else x *= 4;
(C)
(A) true
true
(B) true
false
(C) false
true
(D) false
false
END OF SECTION I
This practice test was created by Ajay Gandecha.
This test and I are not affiliated with, or endorsed by, the College Board.
No questions are copied from the College Board and were made on my own for you to prepare.
Good luck!
Section II – Free Response Section
Optional Time – 15 minutes
2 Questions
1) Fill in the truth table according to the blanks already filled in below.
A B !A A && B A||B
T T
T F
F T
F F
2) Using the grading scale A: 90-100, B: 80-89, C: 70-79, D, 60-69, F: 0-59, write a
program that takes in a double variable myGrade and prints out the letter grade earned.
Use conditionals in your answer.
if myGrade >= 90
System.out.println("A")
else
System.out.println("F)
END OF SECTION II