Welcome to
Unit 3 AP Computer Science A Multiple Choice Questions! Grab some paper and a pencil π to record your answers as you go. You can see how you did on the
Unit 3 Practice Questions Answers and Review sheet once you're done. Don't worry, we have tons of resources available if you get stumped π on a question. And if solo study is not your thing, join a group in
Hours!
Not ready to take a quiz yet?
Start studying unit 3 here: Intro to Unit 3Truth table discussed in key concept 3.6.
Facts about the test: The AP Computer Science A exam has 40 multiple choice questions and you will be given 90 minutes to complete the section. That means it should take you around 34 minutes to complete 15 questions.
*The following questions were not written by CollegeBoard and although they cover information outlined in the AP Computer Science A Course and Exam Description the formatting on the exam may be different.
1. An event that occurs during the execution of a program, that disrupts the normal flow of the instruction is called...
A. comment line
B. exception
C. static
D. method
2. Items whose value does not change are called...e
A. variable
B. stay-same
C. literal
D. unvariable
3.Β A program error that makes it do something other than what the programmer intended is called a...
A. logic error
B. run time error
C. divide by zero error
D. syntax error
4. Which of the following conditions tests whether x is NOT between 1 and 10 (inclusive)?
A. 1 > x && x <= 10
B. !(1 <= x <= 10)
C. 1 <= x || x <= 10
D. 10 < x || x < 1
5. Assume that x & y are boolean variables that have been properly initialized. What will the output be if the value of x is true and the value of y is false?
A. One
B. Two
C. Three
D. OneTwo
6. Temporarily changing the type of arithmetic operand for use in calculations or assignments is called...
A. changing
B. forming
C. casting
D. variable
7. The following truth table matched which boolean condition?
A. A || ( A || B )
B. !A && ( A || !B )
C. A && ( A || B )
D. A && ( A && B )
8. In a list, the place of each item is known as its...
A. place value
B. order
C. gate
D. index
9. The boolean expression (A || B) && A is true...
A. whenever either A is true or B is true
B. whenever A is true
C. whenever B is true
D. whenever A is true and B is true
10. Consider the following code, assuming word is a string, what does the code do?
A. tests if the String word contains only lower case letters
B. tests if the String word contains only upper case letters
C. tests if the String word contains only nonletter characters
D. tests if the String word contains only numeric values
11. Which IF condition correctly checks whether there are sufficient funds in the bank account to withdraw "amount"?
A. if (balance = amount)
B. if {balance >= amount}
C. if (balance >= amount)
D. if [balance >= amount]
12. What is the output by the following code?
A. 11
B. 15
C. 31
D. error
13. Which condition should be used to test whether the contents of two strings string1 and string2 have the same value?
A. (String.equals(string1, string2))
B. (string1.equals(string2))
C. (string1 == string2)
D. (Equals(string1, string2))
14. If string1 and string2 are equal, then string1.compareTo(string2)___________.Β
A. ==true
B. ==null
C. ==0
D. .equals(0)
15. Which of the following statements determines whether a person is ineligible for a junior or senior discount, assuming that a person is eligible for the discount if they are younger than 18 or older than 62?
A. age >= 18 && age > 62
B. age >= 18 || age <= 62
C. age >= 18 && age <= 62
D. age <= 18 || age >= 62
π€Connect with other students studying AP Computer Science A with
Hours