Home›Lesson Plans›Computer Science›Computer Science · Grade 8

Functions & Parameters

Eighth graders learn to write functions — named, reusable blocks of code — and to pass in parameters so one function can handle different inputs, a key step toward organized, powerful programs.

Grade 8Programming50 minutes1 class periodUse → Modify → CreateExplicit 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…

  • ✓Define a function.
  • ✓Explain a parameter.
  • ✓See why functions are reusable.
  • ✓Write a function.
Essential Question

Copying the same code over and over is a nightmare. Functions let you write it once and reuse it — and parameters make each use flexible. How do functions and parameters work?

0
Lesson Phases
0
Vocabulary Terms
0
Standards Aligned
0
Interactive Task
Explore · Interactive

Functions Check

Project each item and have students answer about functions. The tool explains functions, parameters, and reuse.

🔧 Understand functions & parametersTry it
Answer each question about functions and parameters.
The Lesson · Use → Modify → Create (a coding progression with Unplugged practice)

50 minutes, five moves

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

1

Hook — Write Once, Use Often

5 min

Copying code over and over is a nightmare — functions fix that. How?

👩‍🏫 Teacher Moves

  • Show repeated code.
  • Introduce functions.
  • Set the goal.

🎒 Student Actions

  • Consider.
  • Meet them.
  • Predict.
2

Unplugged — Unplug It

11 min

Students practice.

👩‍🏫 Teacher Moves

  • Define a “recipe” function.
  • Give it a parameter.
  • Feel the reuse.

🎒 Student Actions

  • Define it.
  • Add input.
  • Feel it.
3

Use — Functions Check

15 min

Students use.

👩‍🏫 Teacher Moves

  • Send students to Functions Check.
  • Note parameters.
  • Explain reuse.

🎒 Student Actions

  • Answer.
  • Note it.
  • Explain.
4

Modify — Modify It

14 min

Students modify.

👩‍🏫 Teacher Moves

  • Add a parameter to a function.
  • Call it with new values.
  • Predict the results.

🎒 Student Actions

  • Add it.
  • Call it.
  • Predict.
5

Create — Create

5 min

Students conclude.

👩‍🏫 Teacher Moves

  • Write a function with a parameter.
  • Explain the reuse.
  • Complete the exit ticket.

🎒 Student Actions

  • Write it.
  • Explain it.
  • Complete the exit ticket.
Standards Alignment

Built to the standards you report on

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

CSTA
2-AP-14

Create procedures with parameters.

CSTA
2-AP-11

Create clearly named variables.

CSTA
2-AP-16

Incorporate existing code into programs.

ISTE
5

Computational Thinker.

Differentiation

One lesson, every learner

Multilingual Learners

ELL / EMERGING READERS
  • Function + parameter cards.
  • Sentence frame: “A function ___.”
  • Use a recipe analogy.

Support & Access

IEP / 504
  • Start with “reuse code.”
  • Use one simple function.
  • Add one parameter.

Stretch & Extend

GIFTED / EARLY FINISHERS
  • Add return values.
  • Write several functions.
  • Refactor repeated code.
Materials

What to gather

  • 📽️Projector / board
  • 📋Function cards
  • 💻Functions Check
  • 💻Coding tool
  • ✏️Pens
  • 🎫Exit-ticket slips
Vocabulary

Key terms — hover for a quick definition

functiona reusable named block of codeparameteran input to a functionargumentthe value passed incallto run a functionreturna value a function gives backreuseusing code againprocedureanother word for functioninputinformation given to code
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, reusable block of code that does a specific task.
QUESTION 2
What is a parameter?
An input you pass into a function to change what it does.
QUESTION 3
Why are functions useful?
They let you reuse code instead of writing it over and over.

Create: write a function.

Have students describe a function with one parameter they could write for a program. A printable functions sheet 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.

🃏 Functions & ParametersFlip
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.

📝 Functions & ParametersQuiz
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.

🖨️ Functions & ParametersPrint
Name: ________________________
Date: ____________

Part A · Write the word that matches each meaning

Word bank: argument, call, function, input, parameter, procedure, return, reuse
  1. using code again
  2. information given to code
  3. a value a function gives back
  4. another word for function
  5. an input to a function
  6. the value passed in
  7. to run a function
  8. a reusable named block of code

Part B · Show what you learned

  1. What is a function?
  2. What is a parameter?
  3. Why are functions useful?
Answer key — Part A: 1) reuse · 2) input · 3) return · 4) procedure · 5) parameter · 6) argument · 7) call · 8) function
Part B: 1) A named, reusable block of code that does a specific task. 2) An input you pass into a function to change what it does. 3) They let you reuse code instead of writing it over and over.