Updating A Borrower
Interface Definitions:
Inputs to module:
Inputs by user:
Outputs:
"Updating will result in loss of old information. "
"Proceed with Update? "
Data Abstractions:
LAST NAME is a variable length string.
MIDDLE NAME is a variable length string.
FIRST NAME is a variable length string.
ADDRESS is a variable length string.
CITY is a variable length string.
PROVINCE is a variable length string.
POSTAL_CODE is a variable length string.
PHONE is a variable length digit string.
IDENTIFICATION is a positive integer number.
ADDRESS2 is a variable length string.
CITY2 is a variable length string.
PROVINCE2 is a variable length string.
POSTAL_CODE2 is a variable length string.
PHONE2is a variable length digit string.
Design:
Environment: GUI (graphical user interface)
Interface: Pop-up window. (See picture files for a view.)
Completion of this module is performed by:
Sub-Modules:
Error Handling:
Syntactical Errors:
THEN give error window:
Text-Box: "City is unknown, is the spelling correct?"
Text-Box: A similarly spelled city (lexicographically) is displayed.
Buttons: YES, CORRECT, CANCEL
Actions: YES
CORRECT
CANCEL
THEN give error window:
Text-Box: "Province is unknown, is the spelling correct?"
Text-Box: A similarly spelled province (lexicographically) is displayed.
Buttons: YES, CORRECT, CANCEL
Actions: YES
CORRECT
CANCEL
THEN give error window:
Text-Box: "Format of postal-code is unknown, is it correct?"
Buttons: YES, CANCEL
Actions: YES
CANCEL
THEN give error window:
Text-Box: "Format of phone number is unknown, is it correct?"
Buttons: YES, CANCEL
Actions: YES
CANCEL
THEN give error window:
Text-Box: "Identification is already in use. Please enter another"
Buttons: OKAY
Actions: OKAY
Empty-Field Errors:
THEN give error window:
Text-Box: "An identification number MUST be entered!"
"Use OLD identification number?"
Buttons: YES, CANCEL
Actions: YES
CANCEL
THEN give error window:
Text-Box: "Field - "(insert fields name here) "was left empty."
"Continue anyway?"
Buttons: YES, CANCEL
Actions: YES
CANCEL
Imports:
Exports:
bool update_borrower()
{
switch (button)
{
case button = cancel
exit(0);
break;
case button = edit
back to window;
break;
case button = update
output (" the following user will be updated. Do you wish to
continue?");
if (yes)
then
if (last == Null)
output ("last name field is empty continue
anyway?");
if yes continue;
else back to window;
if (first == Null)
output ("first name field is empty continue
anyway?");
if yes continue;
else back to window;
if (middle == Null)
output ("middle name field is empty continue
anyway?");
if yes continue;
else back to window;
if (city not in database)
output ("This city is unknown is the spelling
correct?");
if yes continue;
else back to window;
if (prov/state not in database)
output ("This provence or state is unknown
is the spelling correct?");
if yes continue;
else back to window;
if (id# in database )
ooutput (" This ID number is already in use.
enter another?");
if yes back to window;
else cancel;
if (id# == Null)
output (" An ID number must be entered to add
a borrower to database. Use old ID
number?");
if yes back to window;
else cancel;
break;
}
open datastore borrower;
write new record to datastore;
close datastore borrower;
return (true);
}