Wat is LessonUp
Lesbibliotheek
Kanalen
aiToolsTab
Inloggen
Start gratis
‹
Terug naar zoeken
Functions and Methods in Programming
Functions and Methods in Programming
1 / 12
volgende
Slide 1:
Tekstslide
Computer Science
In deze les zitten
12 slides
, met
interactieve quizzen
en
tekstslides
.
Lesduur is:
45 min
Start les
Bewaar
Deel
Printen
Onderdelen in deze les
Functions and Methods in Programming
Slide 1 - Tekstslide
What is a Function?
A Function is a
REUSABLE
block of code that performs a specific task. Functions
can
take arguments and
can
return values, but neither is required.
Slide 2 - Tekstslide
Why do we use functions?
To make code shorter
To reuse instructions
To confuse the computer
To avoid variables
Slide 3 - Poll
Parts of a Function
Name - Label to call the function
Arguments - Variables that are passed into the function
Body - Steps to follow
Return - The output or result of the function
Slide 4 - Tekstslide
Can you think of something you do every day that could be a function?
Slide 5 - Open vraag
Slide 6 - Tekstslide
Practice
Create a function called Greetings. Greetings takes one argument and returns a greeting using the name.
Create a function called Add that takes two numbers ("a" and "b"). Return the value of a + b
Slide 7 - Tekstslide
What is a function in coding?
A
A type of variable
B
A reusable block of code
C
An error in code
D
A data structure
Slide 8 - Quizvraag
What are arguments in a function?
A
Local variables
B
Values passed to a function
C
Function names
D
Return values
Slide 9 - Quizvraag
What does a return statement do?
A
Exits a function and gives output
B
Calls another function
C
Creates a loop
D
Defines a function
Slide 10 - Quizvraag
Can a function have multiple arguments?
A
Only numbers as arguments
B
Yes, it can have many arguments
C
No, only one argument allowed
D
Only strings as arguments
Slide 11 - Quizvraag
What is a method in coding?
A
A function associated with an object
B
A type of loop
C
A variable type
D
An error handler
Slide 12 - Quizvraag
Meer lessen zoals deze
Programming A Screen Turtle
December 2023
-
19 slides
Computing
Primary Education
LessonUp Inspiration
Time Travelling Programmers
September 2024
-
14 slides
Computing
Primary Education
LessonUp Inspiration
Computing On Spreadsheets 1-2 Lesson Help
February 2024
-
12 slides
Computing
Primary Education
LessonUp Inspiration
Lesson 6. Worldviews and Meaning: Perspectives of World Religions and Humanism
May 2026
-
52 slides
Religious education
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
BTEC, GCSE
ATMT
British Science Week: Coding with SCRATCH
October 2025
-
14 slides
newEditor
Computing
LessonUp
Primary Education
Lower Secondary (Key Stage 3)
LessonUp UK Spotlight
Lesson 4. Utilitarianism: The Greatest Happiness for the Greatest Number
May 2026
-
26 slides
Religious education
Further Education (Key Stage 5)
Upper Secondary (Key Stage 4)
BTEC, GCSE
ATMT
Lesson 1. Introduction to philosophy
May 2026
-
28 slides
Religious education
Further Education (Key Stage 5)
Upper Secondary (Key Stage 4)
BTEC, GCSE
ATMT
Intro to Scratch
December 2023
-
26 slides
Computing
Primary Education
LessonUp Inspiration