|
|
|
|
|
|
|
The Driver: The final step in OOD is to design the driverthe top-level algorithm. As is usually the case in OOD, the driver has very little to do but coordinate the objects that have already been designed. |
|
|
|
|
|
|
|
|
Create empty list of time cards named punchInList
Open punchInFile for input and verify success
punchInList.ReadAll(punchInFile)
punchInList.SelSort()
Get idNum from user
WHILE idNum >0
punchInList.BinSearch(idNum, punchInCard, found)
IF found
punchInCard.Print()
ELSE
Print idNum, has not punched in yet.
Get idNum from user |
|
|
|
|
|
|
|
|
|
Get ID (Out: idNum) Level 1 |
|
|
|
|
|
|
|
|
|
Print blank line
Prompt user for an ID number
Read idNum |
|
|
|
|
|
|
|
|
|
|
On the next page is the PunchIn program showing the implementation of the driver. We use |
|
|
|
|
|