AP CS A Unit 7 Quiz PRACTICE

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Scott Chamberlain
Used 3+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
3 mins • 3 pts
When instantiating a new ArrayList, which data types can we use? Select all that apply:
int
Integer
String
Double
double
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Consider the following code segment.
What is printed as a result of running this code segment?
[1, 2, 3, 4]
[2, 0, 3, 4]
[2, 3, 4]
[1, 3, 4]
[1, 0, 3, 4]
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Suppose the following line is used to replace /* Missing Code */.
System.out.println(list.get(0));
What is printed as a result of executing the code segment?
hotdog costs $2.0
soda costs $0.0
water costs $1.0
none costs $0.0
hotdog costs $2
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Suppose the following line is used to replace /* Missing Code */. System.out.println(list.get(list.size()-1)); What is printed as a result of executing the code segment?
water costs $1.0
water costs $1
hamburger costs $3.5
none costs $0.0
There is an error that occurs because we are trying to access an index out of range
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Suppose the following lines are used to replace /* Missing Code */. list.remove(1);
System.out.println(list.get(1)); What is printed as a result of executing the code segment?
soda costs $-3.0
soda costs $0.0
hotdog costs $2
hotdog costs $2.0
water costs $1.0
6.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
After running the code, what is the size of bulbs?
2
3
4
5
6
7.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Consider the following method that is intended to test if all the Strings in the ArrayList start with a lowercase letter.
Which of the following could replace /* Missing Code */ so that the method works as intended? (You may assume all strings in the ArrayList begin with a letter character.)
I only
II only
III only
II and III
I, II, and III
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Python list starter

Quiz
•
10th Grade - University
10 questions
Pseudocode - OCR ERL

Quiz
•
9th - 12th Grade
10 questions
Python Lists

Quiz
•
8th - 9th Grade
15 questions
AQA Computer Science GCSE - 3.1 Fundamentals of algorithms

Quiz
•
10th - 12th Grade
15 questions
PYTHON PROGRAMMING

Quiz
•
11th - 12th Grade
9 questions
Unit 5 -- Lists, Loops, Traversals

Quiz
•
9th - 12th Grade
12 questions
Homework 1 Edublocks

Quiz
•
7th - 9th Grade
14 questions
AP CSA Review

Quiz
•
11th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade