Unit 2: Abstraction, Algorithms, List

Unit 2: Abstraction, Algorithms, List

9th - 12th Grade

18 Qs

quiz-placeholder

Similar activities

Y9 Creative iMedia RO81 Quiz Part 1

Y9 Creative iMedia RO81 Quiz Part 1

9th Grade

21 Qs

CSS 10 - QUIZ

CSS 10 - QUIZ

10th Grade

20 Qs

Accessing the Internet

Accessing the Internet

9th - 10th Grade

15 Qs

Quiz Pemrograman Perangkat Bergerak 2

Quiz Pemrograman Perangkat Bergerak 2

12th Grade - University

20 Qs

CHỦ ĐỀ A. MÁY TÍNH VÀ XÃ HỘI TRÍ THỨC P1

CHỦ ĐỀ A. MÁY TÍNH VÀ XÃ HỘI TRÍ THỨC P1

10th Grade

20 Qs

CSS GRADE 9 - QUIZ PECs and EM

CSS GRADE 9 - QUIZ PECs and EM

9th Grade

20 Qs

Computing figures

Computing figures

4th - 12th Grade

14 Qs

Unit 2: Abstraction, Algorithms, List

Unit 2: Abstraction, Algorithms, List

Assessment

Quiz

Computers

9th - 12th Grade

Practice Problem

Medium

Created by

Stephannia Kabanakis

Used 12+ times

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

1 min • 1 pt

Consider the following code segment:


myList ← ["red", "yellow", "green", "blue"]

X ← <MISSING CODE>

DISPLAY(X)


What should <MISSING CODE> be replaced with so that “yellow” is displayed after executing the code?

[2]myList

myList[2]

myList[“yellow”]

“yellow”[myList]

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Consider the following code segment:

numberList ← [2, 5, 8, 1]

X ← numberList[1] + numberList[3]

DISPLAY(X)


What will be displayed after executing the code segment?

10

7

13

3

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Consider the following code segment:

words ← [“hello”, “bye”, “no”, “yes”]


Which of the following is a valid index for the list, words?

5

-1

"bye"

4

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

A programmer is writing a sports program that handles football teams and their players. Which of the following is the most appropriate data type to represent a collection of different football player’s names?

String

Boolean

Numeric

List

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Consider the following code segment:

firstList ← ["apple", "banana", "orange"]

secondList ← ["grape", "lemon"]

thirdList ← []

thirdList ← firstList

firstList ← secondList

secondList ← thirdList


What are the contents of secondList after the code segment is executed?

[ ]

["apple", "banana", "orange"]

["grape", "lemon"]

["apple", "banana", "orange", "grape", "lemon"]

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Consider the following code segment:


numbersList ← [8, 6, 2, 1]

APPEND ( numbersList , 4 )

X ← numbersList[1]

Y ← numbersList[5]

Z ← X MOD Y

DISPLAY (Z)


What displays after the code segment is executed?

4

0

3

1

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is a benefit of using a list as a data abstraction in a program?

Lists often allow their size to be easily updated to hold as many data values as needed.

Lists convert all elements to strings so that they can be inspected character-by-character.

Lists prevent duplicate data values from appearing in the list.

Lists are used to store all input data so that there is a running record of all user input.

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?