Search Header Logo
Traversals Practice

Traversals Practice

Assessment

Presentation

Computers

9th - 12th Grade

Practice Problem

Easy

Created by

Katherine Valenti

Used 3+ times

FREE Resource

11 Slides • 2 Questions

1

media

2

media

3

media

4

media

5

media
media

6

media

7

media

8

​Traversal Practice

  • Perform simple traversals over lists that are created inside the code (not with the data import tools)

  • In each program, sample code is provided which you can use to help writing your own code

    • Level 1: Traverse over a list and console.log every element

    • Level 2: Traverse over a list and console.log every element and its position

    • Level 3: Traverse over two parallel lists and print elements from both

9

​Reduce and Filter Practice

  • Practice the reduce and filter patterns introduced in the previous lesson

  • In each program, sample code is provided which you can use to help writing your own code

    • Level 4: Filter a list of students to keep only those with more than 6 letters in their names

    • Level 5: Reduce a list to find the maximum price inside of it

    • Level 6: Filter a list of countries to find those in the Central America region

      • This program makes use of the data import tools.

10

​App Practice

  • Choice level where you will use the reduce and filter patterns to finish building an app

  • You will need to complete TWO of these modules

    • Level 7a: Add code to calculate a user's average grade

    • Level 7b: Add code to allow a user to look up Air Quality data from their state

    • Level 7c: Update a program so that it shows average gas prices for multiple cities across the USA

11

media

12

Open Ended

What aspects of working with traversals do you feel like clicked today? What do you still feel like you have trouble with?

13

Multiple Choice

Question image

What is stored in updatedScores after running the program code?

1

[82, 0, 0, 97, 91]

2

[5, 0, 0, 5, 5]

3

[0, 37, 50, 0, 0]

4

[77, 37, 50, 92, 86]

media

Show answer

Auto Play

Slide 1 / 13

SLIDE