Assessment Tool
Lecture 8: Function Parameters
Content Tested: Control Flow and Data Flow of a Function Call
Lecture Content:
-
Function parameters
-
Control flow/data flow
-
Return values
-
Function prototypes
-
Local variables
Goals:
-
Ability to synthesize and integrate information
-
Learn concepts and theories
-
Develop capacity to think for oneself
Assessment Technique: Mini-Drama
Purpose:
To allow instructors to find out if students understand the execution of
a function call in terms of control flow and data flow. This activity
will give students a chance to design their own model of a function call
and help them remember the actions associated with a function call.
Activity:
We have just seen the purpose of using and the syntax for creating
functions in a program. Today we will learn more about the process
of a function call which you saw in today's lecture. In a group of
3-4 people, design a mini-drama that demonstrates the function call process
for the following code:
int main (void)
{
double x, y, z;
y = 6.0;
x = area(y/3.0);
z = 3.4 * area(7.88);
return 0;
}
/* Find area of circle with radius r */
double area (double r)
{
return (3.14 * r * r);
}
You may want to split up the roles as the "main" person, the "area"
person, and the "controller" who commands the execution. Props such
as cards or pieces of paper with variable names and values might also be
helpful.
After spending about 5 minutes creating your drama, we will share these
with the rest of the class.
Possible Uses of Activity:
-
Instead of breaking the class into small groups, the class could design
and act out a drama together.
-
If time does not permit for students to design their own drama, the instructor
can write one himself/herself and choose volunteers to act out the parts.