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
British Science Week: Coding with SCRATCH
October 2025
-
14 slides
newEditor
Computing
LessonUp
Primary Education
Lower Secondary (Key Stage 3)
LessonUp UK Spotlight
Intro to Scratch
December 2023
-
26 slides
Computing
Primary Education
LessonUp Inspiration
Essay Writing - Exemplar Breakdown (level 2-3)
March 2025
-
11 slides
LessonUp
Upper Secondary (Key Stage 4)
Special Education
Lower Secondary (Key Stage 3)
Further Education (Key Stage 5)
Teaching and Learning Techniques
Lesson 4. Sayings of Jesus
29 days ago
-
21 slides
Religious education
Upper Secondary (Key Stage 4)
Lower Secondary (Key Stage 3)
BTEC, GCSE
ATMT
Lesson 5. The UK & Ireland Debate
29 days ago
-
19 slides
Religious education
Upper Secondary (Key Stage 4)
Further Education (Key Stage 5)
BTEC, GCSE
ATMT