Remove a Book
Removing a Book
Interface Definitions:
Inputs to module:
- Call Number of the library book to be removed.
Inputs by user:
- Name of the Book.
- Publisher of the book.
- Year published of the book.
Outputs:
"Removing will result in loss of book information.
Proceed with Remove?"
Data Abstractions:
CALL NUMBER is a positive integer number.
NAME is a variable length string.
PUBLISHER is a variable length string.
YEAR OF PUBLISHED is a fix length digit string.
Design:
Environment: GUI (graphical user interface)
Interface: Pop-up window. (See picture files for
a view.)
- Every item from Data Abstraction will be entered
in it's own text-box.
- These text-boxes will allow strings larger than
the text-box size to be entered.
- The remove will be a batch process. i.e. none
of the book will be removed until the remove-Book button/key is
activated.
- When the button/key is entered certain items
will be checked for syntactical errors (for errors see ERROR HANDLING).
- CALL NUMBER will be checked against existing
call number.
- NAME will be checked against existing name.
- PUBLISHER will be checked against existing publisher.
- YEAR OF PUBLISHED will be checked against existing
year of published.
Completion of this module is performed by:
- Pressing Cancel - in which case no remove is
performed.
- Pressing Remove - syntactical error checking
is done.
- Confirmation Window is popped up.
At Confirmation Window:
- Pressing Cancel - no remove is performed.
- Confirmation Window is closed.
- Pressing Remove - remove information.
- Confirmation Window is closed.
- Remove window is closed.
- It will be possible to for user to interrupt
this module and do something else. BUT the system cannot close
without explicitly completing this module.
Sub-Modules:
Syntactical Errors:
- IF call number entered does not match any call
number currently in system.
THEN give error window:
Text-Box: "Call number is unknown, is the typing
correct?"
Buttons: CORRECT, CANCEL
Actions: CORRECT
- Change call number.
- Close window.
- Continue error checking.
CANCEL
- Close window.
- Cancel all completion procedures.
- Return to Remove Window.
- IF name entered does not match any name currently
in system.
THEN give error window:
Text-Box: "Name is unknown, is the spelling
correct?"
Text-Box: A similarly spelled name (lexicographically)
is displayed.
Buttons: CORRECT, CANCEL
Actions: CORRECT
- Change name to suggested one.
- Close window.
- Continue error checking.
CANCEL
- Close window.
- Cancel all completion procedures.
- Return to Remove Window.
- IF publisher entered does not match any format
currently in system.
THEN give error window:
Text-Box: "Name of publisher is unknown, is
it correct?"
Buttons: CORRECT, CANCEL
Actions: CORRECT
- Change name to suggested one.
- Close window.
- Continue error checking.
CANCEL
- Close window.
- Cancel all completion procedures.
- Return to Remove Window.
- IF year published entered does not match any
format currently in system.
THEN give error window:
Text-Box: "Format of year published is unknown,
is it correct?"
Buttons: CORRECT, CANCEL
Actions: CORRECT
- Change year published to the correct one.
- Close window.
- Continue error checking.
CANCEL
- Close window.
- Cancel all completion procedures.
- Return to Remove Window.
Empty-Field Errors:
- IF CALL NUMBER field is left empty
THEN give error window:
Text-Box: "A call number MUST be entered!"
Buttons: ADD, CANCEL
Actions: ADD
- Add call number.
- Close window.
- Continue error checking.
CANCEL
- Close window.
- Cancel all completion procedures.
- Return to Remove Window.
- For every other field
THEN give error window:
Text-Box: "Field - "(insert fields name
here) "was left empty."
"Continue anyway?"
Buttons: YES, CANCEL
Actions: YES
- Keep blank field.
- Close window.
- Continue error checking.
CANCEL
- Close window.
- Cancel all completion procedures.
- Return to Remove Window.
Imports:
- Library book's information is retrieved from
the database on entry into this module.
Exports:
- Library book's information is removed from the
database.
Pseudocode/Visual Basic Code
PSEUDOCODE : Remove Book.
///Opening Window
// User inputs the call number for the book here
// Validation sees if the call number is a valid one or
// not
Validation (Call Number)
read (button)
IF button is Ok then
check (Call Number)
If Call number is Valid then
Process (Call Number)
Else
Output Error Message
read (Call Number)
Validation (Call Number)
Elsif button is Cancel
EXIT
END;
End Validation.
// Process actually processes the user request for
// deletion of a book unless a cancel is inputed
Process (Call Number)
IF Book [Call Number].status = on loan THEN
output Error message
EXIT
ELSE
Output Book information
Output Confirmation message
read (User confirmation)
If User Confirmation = Ok
Remove (Book)
Output (Success in deleting book)
Else
Output (No changes made)
EXIT
END
END
END Process.