Objectives:
To demonstrate program exercises from last week
To exercise programming for function object
To work and follow up on Assignment 1
Print out the (completed) program Roster.h, Roster.cc (if any), and the driver program for running the class Roster before the lab and hand in at the beginning of the lab.
Study the function object Adder in CTE 1.3.4.1 and the program adder.cc in CTE 1.3.6.
Read this lab exercise once and prepare necessary materials and make sure
Counter cnt(n); to cout *cnt << endl; in the method
main().(20 minutes) Write up the program counter.cp for
"Constructing a Function Object" in practice problems of Exercise
3. Use the codes there as your main() and create the function object
Counter as specified.
Report the progress of your group work on Assignment 1,
learn the form/venue to submit your assignment, and ask
questions if any.
2 for the program set of Roster.
2 for the program of function object Counter.cp.
Marks are awarded according to the completeness and quality of a program/answer.
0 -- absent (without extenuating circumstance) or no participation at all.
Last modified: October 04, 2002