1 of 47

Chapter 4

Module 2: Intro to Functions &

Data Analysis

2 of 47

Before you teach. . .

You may want to prepare the following before you implement this module in your classroom:

  • Make a copy of the slides if you’d like to revise or adapt them for your classroom
  • Use the teacher dashboard to check student progress.
  • Review Concept Check activities
  • Navigate to Independent Practice slides to:
    • Unlock specific modules and levels as necessary
    • Review extension activities and have activity links ready to share
  • Try out some practice levels on your own
  • Review the solution guide

3 of 47

How to teach a lesson. . .

  • Use the first section of the lesson slides (up to Independent Practice slide) to introduce the new concept for that lesson
  • If applicable, watch any Cutscene videos as a whole class to introduce the story line
  • Extension Activities are found in the speaker notes of the Independent Practice slide. You can use them to differentiate pacing for fast finishers or for students who need reinforcement.
  • Have students independently play through the suggested levels on the Independent Practice slide
    • This section which will also include Cinematics and Concept Checks
  • Use the Check-In section as an opportunity for students to reflect on what they have learned in the lesson

4 of 47

Table of Contents

Lessons

Explorations

Additional Resources

5 of 47

Lesson 1

Introduction to Functions

6 of 47

What did we learn last time?

-How did you use compound conditionals in Ozaria?

-What’s the difference between if/else and else/if conditionals?

-What happened when you met Snikrep and Astra? What did you find out?

-How did you return to Ozaria?

7 of 47

Today’s Journey

Introduction: Functions

Warm Up: Pizza Shop Functions

Play Ozaria: Travel through time and use functions

Optional Extension: Run a Shop with Functions

8 of 47

What are some of your everyday activities?

What are the steps to each of those activities? Do you have to think about each step when you do them?

9 of 47

Functions in Life

Functions are shortcuts that let you simplify steps and instructions. You can put repetitive steps inside a function. Then, you can use the function instead of listing each of those steps.

FUNCTION makePost

OPEN app

START a new post

ADD photo or video

WRITE description

ADD hashtags

TAKE a photo

makePost

MESSAGE with friends

FIND funny cat video

makePost

SCROLL feed

ADD comments

SEE dog chases tail

TAKE a video

makePost

Today’s Social Media Activity

10 of 47

Functions in Code

A function contains a piece of code that you can use over and over again in your program. It provides a shortcut that helps your code stay organized and easier to read.

Original Program

Program with a Function

hero moveRight one

hero moveUp one

hero moveRight one

hero moveUp three times

hero moveRight one

hero moveUp one

hero moveRight one

hero moveDown two times

hero moveRight one

hero moveUp one

hero moveRight one

FUNCTION path

hero moveRight one

hero moveUp one

hero moveRight one

path

hero moveUp three times

path

hero moveDown two times

path

function call

11 of 47

Structured Programming

We are always looking for new ways to make our code faster, efficient, and error proof.

We achieve this with structured programming.

Structured programming uses reusable elements, like variables, to make a program clearer and easy to update.

With regular programming, although it requires less planning ahead, a program is prone to errors and hard to update.

Structured

Regular

12 of 47

Function Parts

A function contains a piece of code that you can use over and over again in your program. It provides a shortcut that helps your code stay organized and easier to read.

FUNCTION path

hero moveRight one

hero moveUp one

hero moveRight one

path

hero moveUp three times

path

hero moveDown two times

path

function call

function definition

function code

function name

13 of 47

Concept Check: Function Parts

Identify the different parts of this program

FUNCTION path

hero moveRight one

hero moveUp one

hero moveRight one

path

hero moveUp three times

path

hero moveDown two times

path

1

2

4

3

14 of 47

Independent Practice

15 of 47

Meet Noodles

You’ll be coding with Noodles the rabbit as a new object, just like you’ve coded with Mouse and other characters.

hero.moveRight()

fox.say("Hi!")

mouse.dig()

noodles.jump()

16 of 47

Independent Practice

Play Ozaria

Start with Cinematic: Before the Storm and stop�after you finish Practice Level: Argumented Rectangles

Run a Pizza Shop with Functions

Use the link provided by your teacher to complete this activity.

Need Help?�Always try it once & try using the troubleshooting guide first. If you still need help after that, then reach out to a classmate or the teacher.

17 of 47

Check-In

18 of 47

What did you discover?

Chapter 4, Module 1, Lesson 1

What I did:

-How far did you get in Ozaria? What was your favorite part?

What I noticed:

-What did you notice as you played through the game?

-Did you discover or learn something new?

What was challenging?�-Was something confusing about the story or the levels?

-Do you need more practice on a specific part of the code or the game?

19 of 47

Lesson 2

Data & Analysis

20 of 47

What did we learn last time?

-How do you use functions in your everyday life?

-How did you use functions to help Noodles collect the glow fruit?

-What happened in Ozaria? What are you trying to make?

21 of 47

Today’s Journey

Review: Data & Analysis

Warm Up: Rock, Paper, Scissors Analysis

Play Ozaria: Use data & analysis to help Noodles

22 of 47

What kind of data have you collected in the past?

Have you collected data through surveys? Spreadsheets? Online tools?

23 of 47

How does data help you make decisions?

How have you used data to help you make predictions and decisions in your life or in past projects?

Data can help you:

  • Predict if it’s going to rain
  • Plan out a marketing plan
  • Make design decisions for your game
  • ?????
  • ?????
  • ????

24 of 47

Computational Models

Computational models use mathematics and computer science to simulate complex systems. You can change the settings of a model and then see how they cause different outcomes. Then you can use that data to make predictions and decisions.

25 of 47

Rock, Paper Scissors!

Try out a computational model and review the data that you collect.

  • Watch the tutorial and learn how to play Rock, Paper, Scissors against Markov. Then start a game.�

  • Use Markov’s previous moves to figure out a pattern in his game strategy

  • You can look at tables and graphs to help you find the pattern

26 of 47

Concept Check: Advanced Rock, Paper Scissors

Use data to set up a strategy and improve your odds of winning!

  • Watch the advanced tutorial and learn how to set your own strategy.

  • Open the graph and make sure the table is set with the settings below. Then see if you can notice a pattern.

Everytime, Markov plays rock and rock, then he always follows with paper. What other patterns do you see?

27 of 47

Independent Practice

28 of 47

Noodles Data

You’ll be using a computational model with Noodles. In the model, you’ll:

- Have a goal. You’ll want to deliver X number of fruits by Y number of seconds (this will change each time)

�- Set the number of glow fruits Noodles will carry and her speed

- Use trial and error by trying different settings and running the model to see the results

- Look at the data to notice a pattern, which will help you find the settings that will meet your goal

29 of 47

Independent Practice

Play Ozaria

Start with Cinematic: Moving On and stop�after you finish Cinematic: The Acodus Loop

Graphing Data with Noodles

Use the link provided by your teacher to complete this activity.

Need Help?�Always try it once & try using the troubleshooting guide first. If you still need help after that, then reach out to a classmate or the teacher.

30 of 47

Check-In

31 of 47

What did you discover?

Chapter 4, Module 2, Lesson 2

What I did:

-How far did you get in Ozaria? What was your favorite part?

What I noticed:

-What did you notice as you played through the game?

-Did you discover or learn something new?

What was challenging?�-Was something confusing about the story or the levels?

-Do you need more practice on a specific part of the code or the game?

32 of 47

Module 2, Lesson 3

Explorations

Computing Systems: �Design Your Own Acodus

33 of 47

Computing Systems

Recall the Acodus. What can the Acodus do?

What have you done with it in Ozaria?

Recall the hardware/software of the Acodus.

What are their jobs?

How does hardware/software collect and store data?

34 of 47

Data Exchange

How does phone’s hardware/software collect and exchange data when you use speech recognition?

HardwareYou say the word “stuff” and the mic on your phone records your voice as audio waves. The screen shows how long you’re recording.

stuff

The software inside the phone converts the audio waves into digital data.

Software

Then it breaks up the data into separate sounds.

The sounds are compared to words in an online or built-in dictionary to find a best match.

HardwareThe best match is displayed on the screen. Then you can touch the screen to send or save what you said.

35 of 47

Analyze the Acodus

What can the Acodus do now? How does its hardware and software collect and exchange data?

hero.moveLeft()

hero.moveUp()

hero.moveRight()

hero.use("door")

Computer System Schematic

Input (includes sensors)

Output

Processor

Memory

36 of 47

Analyze the User Interface

How do you interact with the Acodus when you code?

37 of 47

Improve the Acodus

How would you improve the Acodus? Think about the features you could change: hardware, software, data collection, user interaction, etc.

hero.moveLeft()

hero.moveUp()

hero.moveRight()

hero.use("door")

38 of 47

Design Your Own Acodus

Design a new Acodus that includes some or all of the improvements you’ve written down in the worksheet. Your design documents should include the following:

  1. A diagram of your Acodus: use labels to highlight the new hardware and software components that you’ve added and how data is now collected/exchanged. You can use design tools such as Sketch Up.

  • A sketch of what the new user interaction (UI) for your Acodus will look like. You can use design tools such as Figma,

  • A written document or video that highlights the improvements that you made to the software, hardware and user interaction (UI).

  • A written document or video that highlights how your new design improves the user’s experience with the Acodus

hero.moveLeft()

hero.moveUp()

hero.moveRight()

hero.use("door")

39 of 47

Share

Let’s present your designs!

40 of 47

Resources

Standards Alignment & Additional Resources

41 of 47

CSTA Standards Alignment

Computing Systems

-2-CS-01: Recommend improvements to the design of computing devices, based on an analysis of how users interact with the devices.

-2-CS-02: Design projects that combine hardware and software components to collect and exchange data.

Data and Analysis

-2-DA-08: Collect data using computational tools and transform the data to make it more useful and reliable.

-2-DA-09: Refine computational models based on the data they have generated.

Algorithms & Programming

-1A-AP-10: Develop programs with sequences and simple loops, to express ideas or address a problem.

-1A-AP-11: Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.

-1A-AP-14: Debug (identify and fix) errors in an algorithm or program that includes sequences and simple loops.

-1A-AP-15: Using correct terminology, describe the steps taken and choices made during the iterative process of development.

-1B-AP-10: Create programs that include sequences, events, loops, and conditionals.

-1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.

-1B-AP-12: Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.

42 of 47

CSTA Standards Alignment

Algorithms & Programming (continued)

-1B-AP-15: Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.

-2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

-2-AP-14: Create procedures with parameters to organize code and make it easier to reuse.

-2-AP-15: Seek and incorporate feedback from team members and users to refine a solution that meets user needs.

-2-AP-17: Systematically test and refine programs using a range of test cases.

43 of 47

Common Core State Standards

Writing

-CCSS.ELA-LITERACY.W.6.6: Use technology, including the Internet, to produce and publish writing as well as to interact and collaborate with others; demonstrate sufficient command of keyboarding skills to type a minimum of three pages in a single sitting.

-CCSS.ELA-LITERACY.W.6.10/CCSS.ELA-LITERACY.W.7.10/CCSS.ELA-LITERACY.W.8.10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

-CCSS.ELA-LITERACY.W.7.4/CCSS.ELA-LITERACY.W.8.4: Produce clear and coherent writing in which the development, organization, and style are appropriate to task, purpose, and audience.

-CCSS.ELA-LITERACY.W.7.6: Use technology, including the Internet, to produce and publish writing and link to and cite sources as well as to interact and collaborate with others, including linking to and citing sources.

-CCSS.ELA-LITERACY.W.8.6: Use technology, including the Internet, to produce and publish writing and present the relationships between information and ideas efficiently as well as to interact and collaborate with others.

Speaking & Listening

-CCSS.ELA-LITERACY.SL.6.1/CCSS.ELA-LITERACY.SL.7.1/CCSS.ELA-LITERACY.SL.8.1: Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 6-8 topics, texts, and issues, building on others' ideas and expressing their own clearly.

44 of 47

Common Core State Standards

Speaking & Listening (continued)

-CCSS.ELA-LITERACY.SL.6.4: Present claims and findings, sequencing ideas logically and using pertinent descriptions, facts, and details to accentuate main ideas or themes; use appropriate eye contact, adequate volume, and clear pronunciation.

-CCSS.ELA-LITERACY.SL.6.6/CCSS.ELA-LITERACY.SL.7.6/CCSS.ELA-LITERACY.SL.8.6: Adapt speech to a variety of contexts and tasks, demonstrating command of formal English when indicated or appropriate.

-CCSS.ELA-LITERACY.SL.7.4/CCSS.ELA-LITERACY.SL.8.4/: Present claims and findings, emphasizing salient points in a focused, coherent manner with pertinent descriptions, facts, details, and examples; use appropriate eye contact, adequate volume, and clear pronunciation.

45 of 47

Common Core State Standards

Math: Expressions & Equations

-CCSS.MATH.CONTENT.6.EE.A.2: Write, read, and evaluate expressions in which letters stand for numbers.

-CCSS.MATH.CONTENT.6.EE.B.6: Use variables to represent numbers and write expressions when solving a real-world or mathematical problem; understand that a variable can represent an unknown number, or, depending on the purpose at hand, any number in a specified set.

-CCSS.MATH.CONTENT.6.EE.B.8: Write an inequality of the form x > c or x < c to represent a constraint or condition in a real-world or mathematical problem. Recognize that inequalities of the form x > c or x < c have infinitely many solutions; represent solutions of such inequalities on number line diagrams.

-CCSS.MATH.CONTENT.6.EE.C.9: Use variables to represent two quantities in a real-world problem that change in relationship to one another; write an equation to express one quantity, thought of as the dependent variable, in terms of the other quantity, thought of as the independent variable. Analyze the relationship between the dependent and independent variables using graphs and tables, and relate these to the equation. For example, in a problem involving motion at constant speed, list and graph ordered pairs of distances and times, and write the equation d = 65t to represent the relationship between distance and time.

-CCSS.MATH.CONTENT.7.EE.B.4: Use variables to represent quantities in a real-world or mathematical problem, and construct simple equations and inequalities to solve problems by reasoning about the quantities.

Math: Statistics & Probability

-CCSS.MATH.CONTENT.7.SP.A.2: Use data from a random sample to draw inferences about a population with an unknown characteristic of interest. Generate multiple samples (or simulated samples) of the same size to gauge the variation in estimates or predictions

46 of 47

Common Core State Standards

Math: Statistics & Probability (continued)

-CCSS.MATH.CONTENT.7.SP.C.7: Develop a probability model and use it to find probabilities of events. Compare probabilities from a model to observed frequencies; if the agreement is not good, explain possible sources of the discrepancy.

-CCSS.MATH.CONTENT.7.SP.C.8: Find probabilities of compound events using organized lists, tables, tree diagrams, and simulation.

-CCSS.MATH.CONTENT.8.SP.A.4: Understand that patterns of association can also be seen in bivariate categorical data by displaying frequencies and relative frequencies in a two-way table. Construct and interpret a two-way table summarizing data on two categorical variables collected from the same subjects.

47 of 47

Resource Links