Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

16 - Assume that aList is a valid ArrayList containing the following: 3, 5, 9, 7, 4, 2, 41 Which of the following places -100

16 - Assume that aList is a valid ArrayList containing the following:

3, 5, 9, 7, 4, 2, 41

Which of the following places -100 immediately before 2 in aList?

Question 16 options:

1)

aList.add(-100);

2)

aList.add(-100, 5);

3)

aList.add(4, -100);

4)

aList.add(-100, 4);

5)

aList.add(5, -100);

17 - Assume that aList is a valid ArrayList containing the following:

5.3, 15.1, 8.2, 6.3, 24.1, 2.0, 4.1

Which of the following places -100 immediately after 6.3 in aList?

Question 17 options:

1)

aList.add(-100);

2)

aList.add(4, -100);

3)

aList.add(-100, 4);

4)

aList.add(3, -100);

5)

aList.add(-100, 3);

18 - Assume that aList is a valid ArrayList containing the following:

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

Which of the following removes Anna from aList? (3 points)

I. aList.remove(2, "Anna"); II. aList.remove("Anna"); III. aList.remove("Anna", 2);

Question 18 options:

1)

Statement I only.

2)

Statement II only.

3)

Statement III only.

4)

Statements I and II only.

5)

Statements II and III only.

19 - Assume that aList is a valid ArrayList containing the following:

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

When the following statement executes, what does aList contain?

aList.set(1, "Beth");

Question 19 options:

1)

Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

2)

Wei, Beth, Anna, Neal, Rachel, Jack, Aneesh

3)

Wei, Beth, Marila, Anna, Rachel, Jack, Aneesh

4)

Beth, Marila, Anna, Neal, Rachel, Jack, Aneesh

5)

Beth, Wei, Marila, Anna, Neal, Rachel, Jack, Aneesh

20 - Which of the following would be best handled with an array?

Question 20 options:

1)

A list of all the states in the United States.

2)

A list of cars that get 30 miles per gallon or better.

3)

A list of students who complete AP Computer Science.

4)

The names of animals on the endangered species list.

5)

The titles of books at the library.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions