Remove a Book

Removing a Book

Interface Definitions:

Inputs to module:

Inputs by user:

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.)

Completion of this module is performed by:

  1. Pressing Cancel - in which case no remove is performed.
    • Remove window is closed.
  2. Pressing Remove - syntactical error checking is done.
    • Confirmation Window is popped up.

At Confirmation Window:

  1. Pressing Cancel - no remove is performed.
    • Confirmation Window is closed.
  2. 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:

THEN give error window:

Text-Box: "Call number is unknown, is the typing correct?"

Buttons: CORRECT, CANCEL

Actions: CORRECT

CANCEL

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

CANCEL

THEN give error window:

Text-Box: "Name of publisher is unknown, is it correct?"

Buttons: CORRECT, CANCEL

Actions: CORRECT

CANCEL

THEN give error window:

Text-Box: "Format of year published is unknown, is it correct?"

Buttons: CORRECT, CANCEL

Actions: CORRECT

CANCEL

Empty-Field Errors:

THEN give error window:

Text-Box: "A call number MUST be entered!"

Buttons: ADD, CANCEL

Actions: ADD

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:

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.



Back to the Book Functions Index