πŸ“š

Β >Β 

πŸ’»Β 

Β >Β 

πŸ’Ύ

7.8 Multiple Choice Questions

4 min readβ€’december 24, 2021


AP Computer Science AΒ πŸ’»

130Β resources
See Units

Multiple Choice Practice for ArrayList

Welcome to Unit 7 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 7 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 7 Here: Intro to Unit 7
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-ZzStsUeSJ0Zn.png?alt=media&token=b4b716b7-bba4-4f67-a71f-d9aa92472f6e

Image From Medium.

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. Vehicles are classified based on their total interior volume. The classify method is intended to return a vehicle classification String value based on total interior volume, in cubic feet, as shown in the table (below, see table and sample code). The classify method works as intended for some but not all values of the parameter volume. For which of the following values of volume would the correct value be returned when the classify method is executed?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-O9qU58FszwKy.png?alt=media&token=3ef50a44-92ae-43af-8606-ba7a437f2e27
A. 115
B. 109
C. 105
D. 90

2. Which of the following is a reason to use an ArrayList instead of an array?
A. An ArrayList can allocate more space than it needs.
B. You can store objects in an ArrayList, but not in an array.
C. An ArrayList can grow or shrink as needed, while an array is always the same size.
D. An ArrayList can grow or shrink as needed, while an array is always the same size.

3. What will print when the following code executes?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-R2TCEIbaj4Qf.png?alt=media&token=1e73295e-a10a-4941-b3bb-4994d807238f
A. ["Destini", "Layla", "Sharrie", "Sarah"]
B. ["Sarah", "Layla", "Sharrie"]
C. ["Sarah", "Destini", "Layla", "Sharrie"]
D. ["Sarah", "Destini", "Anaya", "Layla", "Sharrie"]

4. What will print when the following code executes?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-6myQEnB4itoH.png?alt=media&token=da2b1a36-fdc1-4d9f-9735-a532d3c31a05
A. [1, 2, 3, 4, 5]
B. [1, 2, 5, 4, 6]
C. [1, 2, 4, 5, 6]
D. [1, 5, 2, 4, 6]

5. Given the following code, assume that nums is initially [0, 0, 4, 2, 5, 0, 3], what will nums contain as a result of executing numQuest?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-hKbraY5H9BFy.png?alt=media&token=40b35708-6ae1-44b2-ad53-e1384381b7f4
A. [0, 0, 0, 4, 2, 5, 3]
B. [4, 2, 5, 3]
C. [0, 0, 4, 2, 5, 0, 3]
D. [0, 4, 2, 5, 3]

6. Which of the following best describes the behavior of process1 and process2?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-sFhzkrcYpvua.png?alt=media&token=c882e8a5-464c-42cb-80d7-3c0d0b65db99
A. Both methods produce the same result and take the same amount of time.
B. The two methods produce different results and take the same amount of time.
C. The two methods produce different results, and process1 is faster than process2.
D. The two methods produce different results, and process2 is faster than process1.

7. Which of the following best describes a mutable list of object references
A. Method
B. Array
C. ArrayList
D. Object

8. Which of the following is a constructor for a new ArrayList?
A. set ArrayList<E>()
B. new ArrayList<E>()
C. new ArrayList {E}()
D. new ArrayList E;

9. Which of the following is a common error when trying to modify an ArrayList while using an enhanced for loop.
A. OverflowException
B. runtime error
C. Overflow error
D. ConcurrentModificationException

10. Which of the following best describes the information about a person that can be found online?
A. personal privacy
B. personal data
C. security
D. digital footprint

11. Which term defines rules and conventions for communication between network devices
A. network protocols
B. network rules
C. device security
D. network footprints

12. Which of the following terms can be described as a method for finding a target value within a list by sequentially checking each element of the list for the target value until a match is found or until all the elements have been searched.
A. binary search
B. sort protocol
C. linear search
D. parallel search

13. Which of the following terms means to sort an array by repeatedly finding the minimum value, and moving it to the front of the array.
A. MinChoice sort
B. selection sort
C. parallel sort
D. minimum sort

14. Which of the following correctly illustrates the ArrayList L after the given code segment executes?
https://firebasestorage.googleapis.com/v0/b/fiveable-92889.appspot.com/o/images%2F-yTYZzYpryJd0.png?alt=media&token=24201c0f-9c60-4e65-b19e-dcc509dacca6
A. [!, ?, !, ?, ?]
B. [!, !, ?, !, ?, !]
C. [!, !, ?, !, ?]
D. [!, ?, !, ?, !]

15. Which of the following is not a method included in the ArrayList class?
A. int size()
B. int length()
C. Object get(int index)
D. boolean isEmpty()

Time to Check Your Answers on Unit 7 Practice Questions Answers and Review! πŸ™Œ
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.