Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

CSP U5L10 Traversals Investigate Activity Guide

Name:
____________________________________________________________
Level 2

Read through the entire code


Re-read the code for each function.
● average() (lines 32-38)
● slow() (lines 40-48)
● fast() (lines 50-58)
● numberedListDisplay() (lines 60-66)

1. How does the average function work?


a. What list does it use? How is it traversed using a for loop?
It uses the loop to average the distance between every mile ran.
2. How does the slow function work?
a. What list does it use? How is it traversed using a for loop?
Uses a loop to check each mile time. Stores info and uses a for loop
3. How does the fast function work?
a. What list does it use? How is it traversed using a for loop?
Uses a loop to check each mile. Checks if the current index is faster than the one before
4. How does the numberedListDisplay function work?
a. What list does it use? How is it traversed using a for loop?
Displays in a list below each mile it was, and the time it took to run it
5. How does the app work?

Input the mile speeds and it stores the fastest slowest and average time ran.

____________________________________________________________
Level 3
Open the data tab.
1. What does it do?
Lists different breeds of cats
2. How does it work?
Class list and shows on screen
3. What information is available?
Different types of cats their min and max weight and temperament.
4. What can you change? What can't you change?
Can change the information stored
Investigate a few different datasets.
____________________________________________________________
Level 4
1. What are the names of the five lists in this program?
dogNames, dogHeights, dogImages, filteredDogNames, filteredDogImages
2. On what lines of code are the lists created?
2-8
3. On what lines of code are the lists filled?
32-43
4. How are these lists filled?
A four loop
5. Open up the data tab and click to view the dogs table. What columns does this app use?
Name, height, and image
6. Look at the filter function. On what lines are the filtered lists reset to blank lists?
33, 36, 39
7. What condition is being checked to determine if an element belongs in a filtered list?
If the dog size is less than 16, the dog name is filtered

You might also like