Search Header Logo
Pseudocode + Practice Test III

Pseudocode + Practice Test III

Assessment

Presentation

Mathematics

6th - 8th Grade

Practice Problem

Hard

CCSS
RI.5.10, RI.6.4, RI.7.4

+2

Standards-aligned

Created by

Atharv (KMS)

Used 2+ times

FREE Resource

7 Slides • 5 Questions

1

Pseudocode III +

Practice Test

2

Arrays

An array is a data structure (remember those?)


It's like a list of data, for example, [1, 2, 3] or ["a", "b", "c"] (notice how arrays are denoted via square brackets)


In some programming languages arrays can hold data of different types; array [1, "a", 3.5] holds an integer, a letter, and a decimal.

3

2D Arrays

A 2D array is an array of arrays, like so.


x = [

[1, 2, 3],

[4, 5, 6],

[7, 8, 9]

]

4

Array Indexing

Given an array x = [1, 4, 8, 2], use x[0] to get the first element in the array, 1. Use x[i - 1] to get the ith element in the array (so, since the 3rd element is 8, x[2] = 8)


Given the 2D array y = [[1, 2], [3, 4]], y[0] = [1, 2] and y[1] = [3, 4]. Then, y[0][0] = 1 and y[0][1] = 2.

5

Strings

A string is like an array, but it can only hold characters. This is a character: "1". "1" is not the same as 1.


An example of a string would be "How_odd_it_would_be_to_write_without_the_first_letter_of_the_English_lexicon."

6

Strings Indexing

Given the string # = "hashtag"


#[0] = "h", #[4] = "t"

#[:3] = "has" (first 3 letters)

#[4:] = "htag" (last 4 letters)

#[2:5] = "shta" (letters between position 2 and 5 inclusive)

7

Practice Test

8

Multiple Choice

Which of these boolean expressions is most likely 0

1

a * b * c

2

a + b + c

3

1

4

a * b + c

5

c^3

9

Multiple Choice

Question image

Simplify this

1

A

2

AB

3

NOTA + B

4

A * B * NOTC

5

NOTA * NOTB + NOTC

10

Multiple Choice

PUSH("A"), PUSH("M"), PUSH("E"), X = POP(), PUSH("R"), X = POP(), PUSH("I"),

X = POP(), X = POP(), X = POP(), X = POP(), PUSH("C"), PUSH("A"), PUSH("N")

After performing these operations on a queue, what would the next element to be popped out be?

1

E

2

R

3

I

4

C

5

A

11

Draw

Draw a binary search tree of the word, ATHARV.

Here's the alphabet in order... ABCDEFGHIJKLMNOPQRSTUVWXYZ

12

Multiple Choice

Question image

Here's a hint:

The print statement prints out the result

1

RI

2

SA

3

NI

4

GA

5

ET

Pseudocode III +

Practice Test

Show answer

Auto Play

Slide 1 / 12

SLIDE