πŸ“š

Β >Β 

πŸ’»Β 

Β >Β 

πŸ•Ή

4.5 Multiple Choice Questions

3 min readβ€’december 23, 2021

Dalia Savy

Dalia Savy


AP Computer Science AΒ πŸ’»

130Β resources
See Units

Multiple Choice Practice for Iteration

Welcome to Unit 4 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 4 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 4 here: Intro to Unit 4
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-QTo9mipqGHur.png?alt=media&token=51a6512e-e045-43a8-8aa1-7f5cee07fad9

Image Courtesy of Wikipedia.

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 College Board 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. In programming, what is an iteration?
A. A decision point in a program
B. Testing a program to make sure it works
C. The repetition of steps in a program
D. The order that instructions are carried out in a program

2. In programming, why is iteration important or useful?
A. it allows code to be simplified by removing repeated steps
B. it guarantees that the code runs correctly
C. it determined the order that the steps of the code are carried out
D. it allows multiple paths through a program

3.Β  Which two statements are used to implement iteration?
A. WHILE and IF
B. FOR and WHILE
C. IF and ELSE
D. ELSE and WHILE

4. Which type of loop iterates until instructed otherwise?
A. FOR loop
B. Repeat-once loop
C. WHILE loop
D. A count-controlled loop

5. The condition for a WHILE loop to continue could be which of the following?
A. While something is true
B. While something is equal to something else
C. While something is greater than something else
D. All of the above

6. What is the output for the following code?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-P1Qc177CGoCt.png?alt=media&token=e892749b-5303-4af1-aa91-c710e2a5d34f
A. 0 3 6 9 12
B. 12 9 6 3 0
C. 0 3 6 9
D. 9 6 3 0

7.Β What is the output for the following code?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-GSB57JjuPy0P.png?alt=media&token=c8ea1a84-8ec1-44fb-81dc-4eee90a93707
A. Hello, world! Hello, world! Hello, world! (repeated without end)
B. Hello, World!
C. error
D. Hello, World

8. This causes a loop to terminate early
A. switch
B. continue
C. break
D. end

9. This type of loop has no way of ending and repeats until the program is interrupted.
A. infinite
B. indeterminate
C. interruptible
D. timeless

10. What kind of variable controls the number of iterations performed by a loop?
A. repetition variable
B. accumulator
C. double
D. loop control variable

11. What is the output of the following code fragment?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-Tp5TY7Q5Y6fR.png?alt=media&token=f4916ef0-7183-4791-83fc-ae0ac5f1e836
A. 2
B. 50
C. 75
D. 25

12. The "less than or equal to" comparison in Java is which of the following?
A. <<
B. <=
C. =<
D. <

13. If x is an integer and x = 1, what will be the value of x after the following loop terminates?Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-Cy7v5bPfrMTb.png?alt=media&token=3331a418-3eb7-4827-af41-2a9e119c7751
A. 2
B. 64
C. 100
D. 128

14. What would be printed out after the following code?Β 
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-9I8n2IeXZUqm.png?alt=media&token=a19c2bb4-e066-4573-bd5c-46a99755e48d
A. O
B. H
C. N
D. Y

15. What does equal ( ) return?
A. boolean
B. string
C. char
D. double

πŸ™ŒTime to Check Your Answers on Unit 4 Practice Questions Answers and Review!Β 
🀝Connect with other students studying AP Comp Sci A with Hours
Browse Study Guides By Unit
βž•Unit 1 – Primitive Types
πŸ“±Unit 2 – Using Objects
πŸ–₯Unit 3 – Boolean Expressions & if Statements
πŸ•Ή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

Fiveable
Fiveable
Home
Stay Connected

Β© 2023 Fiveable Inc. All rights reserved.


Β© 2023 Fiveable Inc. All rights reserved.