Arrays += Chan

Arrays += Chan

9th - 12th Grade

12 Qs

quiz-placeholder

Similar activities

Java 1

Java 1

11th Grade

13 Qs

Project STEM AP CS A Unit 1 Quiz Review

Project STEM AP CS A Unit 1 Quiz Review

9th - 12th Grade

11 Qs

Python

Python

6th Grade - University

15 Qs

java

java

10th Grade

15 Qs

Программирование C#

Программирование C#

1st - 10th Grade

10 Qs

С№ 15

С№ 15

10th Grade

10 Qs

C_หน่วย 3

C_หน่วย 3

12th Grade

10 Qs

T_4.2 Identifier, Data Types, Operators & Expressions

T_4.2 Identifier, Data Types, Operators & Expressions

12th Grade - University

10 Qs

Arrays += Chan

Arrays += Chan

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Raymond Chan

Used 477+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

Given the following code segment what will be returned when you execute: getIndexOfLastElementSmallerThanTarget(values,-13);

A. -1

B. -15

C. 1

D. You will get an out of bounds error.

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

Given the following code segment what would be the elements of a when you execute: doubleLast();

A. {-40, -30, 4, 16, 32, 66}

B. {-40, -30, 4, 8, 16, 32}

C. {-20, -15, 2, 16, 32, 66}

D. {-20, -15, 2, 8, 16, 33}

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Media Image

What is returned from mystery when it is passed {10, 30, 30, 60}?

A. 17.5

B. 30.0

C. 130

D. 32

E. 32.5

4.

FILL IN THE BLANK QUESTION

15 mins • 1 pt

Media Image

What is the output of the code segment?

5.

MULTIPLE SELECT QUESTION

15 mins • 1 pt

Media Image

Select all missing code that works.

int i = ans.length; i >= 0; i--

int i = ans.length-1; i >= 0; i--

int i = ans.length-1; i > 0; i--

int i = 0; i < ans.length; i++

int i = 0; i <= ans.length; i++

6.

MULTIPLE SELECT QUESTION

15 mins • 1 pt

Given an array of length 5, what are the indexes of the middle three elements?

4

2

1

0

3

7.

MULTIPLE SELECT QUESTION

15 mins • 1 pt

Given an array of length 3, called arr, what is the middle element?

arr[1]

2

1

arr[2]

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?