Unit 4 quiz ap Computer Science

  • decks
  • flashcards
  • learners

The creator of this deck did not yet add a description for what is included in this deck.

Unit 4 quiz ap Computer Science

  • Class purpose General learning

The creator of this class did not yet add a description for what is included in this class.

Brainscape's adaptive web mobile flashcards system will drill you on your weaknesses, using a pattern guaranteed to help you learn more in less time.

Brainscape is a digital flashcards platform where you can find, create, share, and study any subject on the planet.

We use an adaptive study algorithm that is proven to help you learn faster and remember longer.

📚

 > 

💻 

 > 

🕹

3 min readdecember 23, 2021

Unit 4 quiz ap Computer Science

AP Computer Science A 💻

Bookmarked 3.3k • 113 resources

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

Unit 4 quiz ap Computer Science

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?

Unit 4 quiz ap Computer Science

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?

Unit 4 quiz ap Computer Science

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?

Unit 4 quiz ap Computer Science

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? 

Unit 4 quiz ap Computer Science

A. 2

B. 64

C. 100

D. 128

14. What would be printed out after the following code? 

Unit 4 quiz ap Computer Science

A. O

B. H

C. N

D. Y

15. What does equal ( ) return?

A. boolean

B. string

C. char

D. double

🤝Connect with other students studying AP Comp Sci A with Hours

Was this guide helpful?