|
|
|
|
|
|
|
Open friendFile for output (and verify success)
Set length = 0
DO
Get entry
PrintIs this entry correct? (Y or N)
Read response
IF response is Y or y
Insert entry into addressBook, updating length
Print Do you wish to continue? (Y or N)
Read response
WHILE response is Y or y AND length < MAX_FRIENDS
Write entries to file friendFile |
|
|
|
|
|
|
|
|
|
Finally, we must redo the Get Entry and Write Entries modules, filling in the parameter lists and the details that depend on our chosen data structure. |
|
|
|
|
|
|
|
|
Get Entry (Out: entry) Level 1 |
|
|
|
|
|
|
|
|
Get name
Get phone number
Prompt user for birth date
Read entry.month, entry.day, entry.year |
|
|
|
|
|
|
|
|
|
Write Entries (In: addressBook, length; Inout; friendFile) |
|
|
|
|
|
|
|
|
|
FOR counter going from 0 through length 1
Write addressBook[counter].firstName, ,
addressBook[counter].lastName to friendFile
Write (, addressBook[counter].areaCode, ),
addressBook[counter].phoneNumber to friendFile
Write addressBook[counter].month, /,
addressBook[counter].day, /,
addressBook[counter].year to friendFile |
|
|
|
|
|
|
|