Search Header Logo

IP MIDTERM

Authored by Danny Casimero

Computers

University

Used 11+ times

IP MIDTERM
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

45 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

An array is a list of data items that __________.

all have the same type
all have different names
all are integers
all are null

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following can be used as an array subscript?

character
double
int
String

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Assume an array is declared as follows. Which of the following statements correctly assigns the value 100 to each of the array elements? int[] num = new int[4];

for(x=0; x<3; ++x) num[x] = 100;
for(x=0; x<4; ++x) num[x] = 100;
for(x=1; x<4; ++x) num[x] = 100;
for(x=1; x<3; ++x) num[x] = 100;

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Suppose you declare an array as follows: int[] creditScores = {670,720,815} What is the value of creditScores.lenght?

0
1.0
2.0
3.0

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

If a class named Student contains a method setID() that takes an int argument and you write an application in which you create an array of 20 Student objects named scholar. Which of the following statements correctly assigns an ID number to the first Student scholar?

Student[0].setID(1234);
scholar[0].setID(1234);
Student.setID[0].(1234);
scholar.setID[0](1234);

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

The following defines a ____ array. Int[][] nums = {{1,2} ,{3,4},{5,6}};

one dimensional
two dimensional
three dimensional
six dimensional

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

How many rows are contained in the following array? double [][] prices = {{2.56, 3.57, 4.58, 5.59}, {12.35, 13.35, 14.35, 15.00}};

1.0
2.0
4.0
8.0

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