πŸ“š

Β >Β 

πŸ’»Β 

Β >Β 

πŸ–₯

3.8 Multiple Choice Questions

4 min readβ€’december 28, 2021


AP Computer Science AΒ πŸ’»

130Β resources
See Units

Multiple Choice Practice for Boolean Expressions and if Statements

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 3
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-2h3RfibWt7Lh.png?alt=media&token=70c5ca09-4cf0-41a7-a651-5c2d004c87b9

Truth 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?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-kIpVDReE7JJ7.png?alt=media&token=00271f4e-4b7a-407d-96f7-beeaec02a9f8
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?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-Ct71OicI97lF.png?alt=media&token=89d8c8df-8e27-4f3c-ba6c-6a1ed0925dd0
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?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-3pOUOZK9OBP8.png?alt=media&token=9d4a82b4-2279-4674-91df-7b700ad67dc5
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?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-Gw5AsgUQiqOU.png?alt=media&token=2ff0b2e7-c3a4-4222-b2eb-54772a6fa1b4
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

πŸ™ŒTime to Check Your Answers on Unit 3 Practice Questions Answers and Review!Β 
🀝Connect with other students studying AP Computer Science A with Hours
Browse Study Guides By Unit
βž•Unit 1 – Primitive Types
πŸ“±Unit 2 – Using Objects
πŸ•ΉUnit 4 – Iteration
βš™οΈUnit 5 – Writing Classes
⌚️Unit 6 – Array
πŸ’ΎUnit 7 – ArrayList
πŸ’»Unit 8 – 2D Array
πŸ–²Unit 9 – Inheritance
πŸ–±Unit 10 – Recursion
πŸ™Exam Reviews