Assessment Tool
Lecture 10: Loops
Content Tested: Applications and Choice of Loops
Lecture Content:
-
Loop design and development
-
Code reuse
Goals:
-
Develop ability to apply principles and generalizations already learned
to new problems and situations
-
Learn concepts and theories
-
Develop capacity to think for oneself
Assessment Technique: Application Cards
Purpose:
Instructors can find out how well students understand possible applications
of what they have learned.
Activity:
Say the following to the students:
We have seen how to write "for" and "while" loops in lecture.
State one or more applications where you see loops in gadgets, appliances,
software, or a task. Also, state the application of the tool and
what type of loop you think this tool uses. Why did you decide on
a "for" loop or a "while" loop?
Students may need to see some examples before thinking of an application
on their own. Here are examples of possible applications:
cooking/kitchen timer
application: counts down to zero from a time given by user and
beeps/buzzes when time has expired
type of loop: "for", given a time, there are a set number of
times the loop which counts down the time will execute
printing a search engine results list
application: list the "hits" found that match key words
type of loop: "for" if the engine looks through entire database or
web and then prints out a list of "hits". This printing is the action
executed each time through the loop; "while" if the engine prints results
as they are found since the engine doesn't know in advance how many listings
should be printed.
A parent packing lunches for his/her family
application: Each lunch gets a sandwich, fruit, and beverage
type of loop: "for" since the parent packs a lunch for each member
of the family. The number of members in the family is known.
The body of the loop contains the actions of packing a sandwich, fruit,
and beverage in each lunch.
Possible Uses of Activity:
-
Have students write applications individually and submit these to the instructor
anonymously. The instructor reads the applications and the class
discusses the use/type of loops in these applications.
-
Each student writes an application and explains their application to the
rest of the class.
-
Break students into small groups (2-4 people) and have each group find
two or more applications. Have each group explain their applications
to the rest of the class.