Truth table discussed in key concept 3.6.
β
STOP!β Before you look at the answers make sure you gave this practice quiz a try so you can assess your understanding of the concepts covered in unit 3. Click here for the practice questions:
AP Computer Science A Unit 3 Multiple Choice Questions.
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
Answer: This is the definition of exception.
2. Items whose value does not change are called...
A. variable
B. stay-same
C. literal
D. unvariable
Answer: This is the definition of a literal item.
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
Answer: This is an example of a logic error.
π Study AP Computer Science A, Unit 3.0: Unit 3 Overview
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
Answer: This question tests your knowledge of logic syntax.
π Study AP Computer Science A, Unit 3.5: Compound Boolean Expressions
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
Answer: || is OR, && is AND, ! is NOT or negation
π Study AP Computer Science A, Unit 3.5: Compound Boolean Expressions
6. Temporarily changing the type of arithmetic operand for use in calculations or assignments is called...
A. changing
B. forming
C. casting
D. variable
Answer: This is the definition of casting
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 )
Answer: evaluation of truth tables: || is OR, && is AND, ! is NOT or negation
π Study AP Computer Science A, Unit 3.6: Equivalent Boolean Expressions
8. In a list, the place of each item is known as its...
A. place value
B. order
C. gate
D. index
Answer: Index is the location/place of an item
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
Answer: || is OR and && is AND..
π Study AP Computer Science A, Unit 3.5: Compound Boolean Expressions
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
Answer: Boolean check to see if the string word is the same as it is when lower case
π Study AP Computer Science A, Unit 3.0: Unit 3 Overview
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]
Answer: The correct syntax is with parentheses.
π Study AP Computer Science A, Unit 3.0: Unit 3 Overview
12. What is the output by the following code?
A. 11
B. 15
C. 31
D. error
Answer: x=10, increases to 11 which is < 31 so 11 is displayed
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))
Answer: This question tests your knowledge of Java syntax.
14. If string1 and string2 are equal, then string1.compareTo(string2)___________.Β
A. ==true
B. ==null
C. ==0
D. .equals(0)
Answer: Syntax, logical equivalency
π Study AP Computer Science A, Unit 3.7: Comparing Object
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
Answer: This question tests your knowledge of Boolean syntax.
π Study AP Computer Science A, Unit 3.6: Equivalent Boolean Expressions
What can we help you do now?
π¦Jump to AP Computer Science A Unit 4 Multiple Choice Questions π€Connect with other students studying AP Computer Science A with Hours