Lesson 4.10 Functions Practice
Oct 4 (A-day) and Oct 5 (B-day)
Oct 4 (A-day) and Oct 5 (B-day)
Bubbles 1-5 Declare and Call Functions
2 - Rearrange call order and add
5- Refining program code by declaring and calling functions
Bubbles 6-7 Function Scope
Bubbles 8-9 Declare Functions
Function: a name of group of programming instructions. Also referred to as a "procedure."
Global Variables - Permanent. Can be used anywhere in your code.
Local Variables - Temporary. Can be used only in the part of the code where it was created, like inside an onEvent(). Deleted once the onEvent() is done running.
In this lesson students spend most of their time practicing using the skills and processes they have learned about functions. At the conclusion of the lesson students discuss remaining questions in anticipation of their Make project in the following lesson.
This lesson is students primary opportunity to get hands on with functions in code prior to the Make activity in the following lesson. Give students as much class time as you can to work through these. For this lesson it's recommended that you place students in pairs as a support and to encourage discussion about the challenges or concepts they're seeing. In the following lesson students are encouraged to work independently.
CSP Conceptual Framework
AAP-3 - Programmers break down problems into smaller and more manageable pieces. By creating procedures and leveraging parameters, programmers generalize processes that can be reused. Procedures allow programmers to draw upon existing code that has already been tested, allowing programmers to write programs more quickly and with more confidence.
AAP-3.A - For procedure calls: a. Write statements to call procedures. b. Determine the result or effect of a procedure call.
CSTA K-12 Computer Science Standards (2017)
AP - Algorithms & Programming
3A-AP-17 - Decompose problems into smaller components through systematic analysis, using constructs such as procedures, modules, and/or objects.
3B-AP-14 - Construct solutions to problems using student-created components, such as procedures, modules and/or objects.