AP CS A Unit 7 Quiz PRACTICE

AP CS A Unit 7 Quiz PRACTICE

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

C++ Arrays

C++ Arrays

8th - 12th Grade

12 Qs

Ap computer science a

Ap computer science a

1st - 12th Grade

15 Qs

AP CS A FRQ ArrayLists

AP CS A FRQ ArrayLists

10th Grade

11 Qs

Introduction to ArrayList

Introduction to ArrayList

10th Grade

11 Qs

2D Arrays

2D Arrays

9th - 12th Grade

15 Qs

ArrayList

ArrayList

10th - 12th Grade

11 Qs

Advanced Java Study Guide

Advanced Java Study Guide

11th - 12th Grade

10 Qs

Arrays

Arrays

10th - 12th Grade

10 Qs

AP CS A Unit 7 Quiz PRACTICE

AP CS A Unit 7 Quiz PRACTICE

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

After running the code, what is the size of bulbs?

2

3

4

5

6

7.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?