Array_to be discussF3

Array_to be discussF3

University

18 Qs

quiz-placeholder

Similar activities

Control Structures  C#

Control Structures C#

University

20 Qs

PROGRAMMING CAMP

PROGRAMMING CAMP

University

20 Qs

Kuis 1 Dasar Pemrograman

Kuis 1 Dasar Pemrograman

University

20 Qs

Bridge course with C

Bridge course with C

University

20 Qs

UAS SDL INF 20201

UAS SDL INF 20201

University

20 Qs

Fundamentals of Algorithms - Unit 1 - Test 1

Fundamentals of Algorithms - Unit 1 - Test 1

University

15 Qs

ARRAY

ARRAY

University

22 Qs

DCN5511: Chapter 5 - 7

DCN5511: Chapter 5 - 7

University

15 Qs

Array_to be discussF3

Array_to be discussF3

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

ZURAIDAH Moe

FREE Resource

AI

Enhance your content in a minute

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

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

int[] myArray = {11, 22, 33, 44, 55};

Which of the following is the code to print the length of this array?

System.out.println(int[].myArray.length());

System.out.println(myArray.length);

System.out.println(myArray.length());

System.out.println(int[].myArray.size());

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String[] friends = {"John", "Mike", "Samantha", "Monica"};

which code is correct to print "Samantha" using array functionality?

System.out.println(friends[2]);

System.out.println(friends[3]);

System.out.println(friends["Samantha"]);

System.out.println(friends{2});

3.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Select correct code to create an array of "double" datatype of length 5.

double arr = double[5];

double{} arr = new double{5};

double[5] arr = new double[];

double[] arr = new double[5];

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the relationship between the length of an array and the last index of that array?

last-index is always 1 more than the length

last-index is 1 less than the length (but not always)

last-index is always 1 less than the length

last-index is always equal to the length

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Code to declare an array that stores the scores (mark) for 20 students.

double mark;

double [20] mark = new double;

double [ ] mark = new mark [20];

double [ ] mark = new double [20];

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Code to declare an array that stores the names of 15 students.

String [ ] name = new String;

String [ ] name = new String [15];

name = new String [15];

String [15] name = new String [ ];

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Java code to display the size of an array name studentname[ ].

System.out.println("The size is " + studentname[ index ]);

System.out.println("The size is " + studentname.length);

System.out.println("The size is " + length.length);

System.out.println("The size is " + studentname);

Access all questions and much more by creating a free account

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

Already have an account?

Discover more resources for Computers