Introduction to Arrays

Introduction to Arrays

KG - University

10 Qs

quiz-placeholder

Similar activities

8525 AQA GCSE  3.1.1 Pseudo-code

8525 AQA GCSE 3.1.1 Pseudo-code

10th - 11th Grade

14 Qs

Programs and Variables in Code and Play

Programs and Variables in Code and Play

5th - 9th Grade

7 Qs

5.3. Запис математичних виразів на мові Python

5.3. Запис математичних виразів на мові Python

8th Grade

13 Qs

Pengantar Coding

Pengantar Coding

University

10 Qs

Archivos Digitales

Archivos Digitales

9th Grade - University

14 Qs

VR and AR in multimedia applications

VR and AR in multimedia applications

University

10 Qs

Parcial-Dibujo

Parcial-Dibujo

12th Grade

10 Qs

OOP 1 Undiksha

OOP 1 Undiksha

12th Grade - University

13 Qs

Introduction to Arrays

Introduction to Arrays

Assessment

Quiz

Computers

KG - University

Practice Problem

Hard

Created by

Ryan Goulet

Used 167+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What are the legal indexes for the array ar, given the following declaration:
int[] ar = {2, 4, 6, 8 }

 0, 1, 2, 3
 1, 2, 3, 4
2, 4, 6, 8
 0, 2, 4, 6

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following declares an array of int named img?

int img;
int[] img;
new int img[];
int img = int[];

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code fragment:
int[] ar = {2, 4, 6, 8 };
 System.out.println( ar[0] + " " + ar[1] ); 

 2 6
8
 2 4
 6 8

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code fragment:
int[] ar = {2, 4, 6, 8 }; ar[0] = 23; ar[3] = ar[1]; SOP( ar[0] + " " + ar[3] );

23 2
2 8
31
23 4

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code fragment:
int[] y = new int[5]; y[0] = 34; y[1] = 88; SOP( y[0] + " " + y[1] + " " + y[5] );

34 88 0
34 88 88
 The program is defective and will not compile.
0 34 88

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code fragment:
int[] z = new int[9]; 
z[0] = 7;
z[1] = 3; 
z[2] = 4; 
SOP(z[0] + z[1] + " " + z[5] ); 

10 0
7 3 0
The program is defective and will not compile.
7 3 4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What expression represents the last element of any size array named array?

array[length-1]
array[length]
 array[array.length]
array[array.length-1]

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?