Search Header Logo

Syed: 1D Array

Authored by Syed M

Computers

9th Grade

Used 20+ times

Syed: 1D Array
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

55 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 5 pts

What is an Array?

A data structure consisting of a collection of elements grouped under a single name.

  1. A collection of functions grouped under a single name.

  1. A variable that can store multiple data types simultaneously.

  1. A programming method used to iterate through data elements.

Answer explanation

A data structure consisting of a collection of elements grouped under a single name.

2.

DRAG AND DROP QUESTION

3 mins • 5 pts

Can an Array store values of different datatypes?

(a)  

Yes

No

Maybe

Not sure

Possibly

Answer explanation

No, an Array cannot store values of different datatypes as it requires all elements to be of the same type.

3.

MULTIPLE CHOICE QUESTION

3 mins • 5 pts

Guess the output.

names=["Lisa","Jane","William"]

print(names[1])

Lisa

Jane

William

Error

Answer explanation

The correct answer is Jane because names[1] accesses the element at index 1 in the list, which is 'Jane'.

4.

MULTIPLE CHOICE QUESTION

3 mins • 5 pts

What is the ouput?

DECLARE nums: ARRAY[0:4] OF INTEGER

nums ← [5, 10, 15, 20, 25]

OUTPUT(nums[2])

5

10

15

25

Answer explanation

The output is 15 because nums[2] refers to the element at index 2 in the array nums, which is 15.

5.

MULTIPLE CHOICE QUESTION

3 mins • 5 pts

If an array data contains five elements [5, 3, 7, 1, 9], what is the value of data[3]?

5

3

7

1

Answer explanation

The value of data[3] is 1 because array indexing starts at 0, so data[3] refers to the fourth element in the array which is 1.

6.

MULTIPLE SELECT QUESTION

3 mins • 5 pts

Which pseudocode initializes an array of size 10.

DECLARE nums: ARRAY[0:9] OF INTEGER

DECLARE nums: ARRAY[1:10] OF INTEGER

DECLARE nums: ARRAY[1:9] OF INTEGER

DECLARE nums: ARRAY[0:10] OF INTEGER

Answer explanation

The correct pseudocode to initialize an array of size 10 is DECLARE nums: ARRAY[0:9] OF INTEGER or DECLARE nums: ARRAY[1:10] OF INTEGER.

7.

MATH RESPONSE QUESTION

3 mins • 5 pts

How many elements are in the following array?

DECLARE items: ARRAY[0:4] OF STRING

items ← ["apple", "banana", "cherry", "date", "elderberry"]

Mathematical Equivalence

ON

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?