Home›Lesson Plans›Computer Science›Programming · Grade 5

Coding Functions

Fifth graders learn functions — a way to name a group of steps once and reuse it again and again. They build a greet() function in order, then call it, so they never have to rewrite the same steps.

Grade 5Functions45 minutes1 class periodCSTA / ISTEExplicit teaching4 StandardsCSTA
Start the Lesson
Assign or share this lesson

Copy link works with Canvas, Schoology, Moodle and any other LMS — paste it in as a resource or assignment.

Lesson at a Glance

Everything you need before the bell rings

Learning Objectives

Students will be able to…

  • ✓Explain what a function is.
  • ✓Put steps inside a named function.
  • ✓Call a function to reuse it.
  • ✓See why functions save work.
Essential Question

How can you name a group of steps and reuse it?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Put in Order · Interactive

Build the greet() Function

Project this and have students put the steps inside the function in the right order.

🧱 Put the function’s steps in order — then call it!Try it
Tap “define greet()” first!
The Lesson · Use → Modify → Create (a coding progression with Unplugged practice)

45 minutes, five moves

Tap any phase to open the teacher moves and student actions.

1

Hook — Why Repeat Yourself?

5 min

What if you had to greet 10 people with the same 3 steps?

👩‍🏫 Teacher Moves

  • Write the 3 greeting steps.
  • Ask “how could we reuse them?”
  • Set the goal.

🎒 Student Actions

  • Watch.
  • Guess.
  • Get ready.
2

Use — Functions

10 min

Students use functions.

👩‍🏫 Teacher Moves

  • Send students to Build the greet() Function.
  • Order the steps.
  • Name it greet().

🎒 Student Actions

  • Order.
  • Say.
  • Name it.
3

Modify — Call It Twice

12 min

Students modify.

👩‍🏫 Teacher Moves

  • Call greet() once.
  • Call greet() again — same steps!
  • Count lines saved.

🎒 Student Actions

  • Call.
  • Call.
  • Count.
4

Create — Make Your Own

12 min

Students create.

👩‍🏫 Teacher Moves

  • Design a function (e.g. cheer()).
  • List its steps.
  • Give it a clear name.

🎒 Student Actions

  • Design.
  • List.
  • Name.
5

Reflect — Reflect

6 min

Students close.

👩‍🏫 Teacher Moves

  • Say what a function is.
  • Say why it saves work.
  • Complete the exit ticket.

🎒 Student Actions

  • Say it.
  • Say.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

Aligned to the CSTA K-12 Computer Science Standards and the ISTE Standards for Students.

CSTA
1B-AP-11

Decompose a problem into smaller named parts.

CSTA
1B-AP-10

Create programs with sequences, events, loops & conditionals.

CSTA
1B-AP-12

Modify or remix programs to develop something new.

ISTE
5 Computational Thinker

Break problems into reusable parts.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Act the steps out as a “routine.”
  • Frame: “First… then… finally…”
  • Name functions with verbs.

Support & Access

IEP / 504
  • Use 3 steps, not 4.
  • Order two at a time.
  • Use picture cards.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add an input (greet a name).
  • Write a 2nd function.
  • Call both in one program.
Materials

What to gather

  • 📽️Screen / board
  • 🧱Step cards
  • 💻Build the greet() Function
  • 🎮Scratch or paper code
  • 📓Notebooks
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

functiona named group of steps you can reusedefineto create a function and its stepscallto run a function by its namereuseto use the same code againnamewhat you call the functionstepone instruction inside the functioninputa value you pass into a functiondecomposeto break a task into smaller parts
Evaluate

Exit Ticket

Preview the three formative checks. Tap “Sample answer” to see what mastery looks like — hide them before you print for students.

QUESTION 1
What is a function?
A named group of steps you can reuse.
QUESTION 2
How do you run a function?
You “call” it by its name.
QUESTION 3
Why are functions useful?
They let you reuse steps instead of rewriting them.

Reflect: functions.

Have students name one function a game might reuse (like jump() or shoot()). A printable functions worksheet is in the Computer Science library.

Study · Flashcards

Study the key terms

Tap a card to flip it, then rate whether you knew it. Built from this lesson’s vocabulary.

🃏 CS Functions (Grade 5)Flip
Card 1
Term
Tap to flip →
Meaning
0

Nice work!

Practice · Quiz

Check your understanding

A quick self-check with instant feedback, drawn from this lesson’s key terms.

📝 CS Functions (Grade 5)Quiz
Score: 0
1 / 6
Question 1
0%

Nice work!

Practice · Worksheet

Printable worksheet

A print-and-go review sheet with a built-in answer key. Tap “Show answer key” to reveal answers, or print the clean version for students.

🖨️ CS Functions (Grade 5)Print
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: call, decompose, define, function, input, name, reuse, step
  1. to break a task into smaller parts
  2. a named group of steps you can reuse
  3. to create a function and its steps
  4. one instruction inside the function
  5. a value you pass into a function
  6. what you call the function
  7. to run a function by its name
  8. to use the same code again

Part B · Show what you learned

  1. What is a function?
  2. How do you run a function?
  3. Why are functions useful?
Answer key — Part A: 1) decompose · 2) function · 3) define · 4) step · 5) input · 6) name · 7) call · 8) reuse
Part B: 1) A named group of steps you can reuse. 2) You “call” it by its name. 3) They let you reuse steps instead of rewriting them.