Implementation of Compact Disc Database Manager

Go to Package Interface

WITH Ada.Text_IO;
PACKAGE BODY Compact IS
------------------------------------------------------------------
--| Implementation of package providing data structures and 
--| operations for manipulating a simple "data base" of audio compact 
--| discs, each record containing a code number, artist, disc title, 
--| category of disc, date of purchase, and price you paid.
--| 
--| The package makes use of resources provided 
--| by the package Simple_Dates.
--|
--| Author: Michael B. Feldman, The George Washington University
--| Last Modified: March 1997    
------------------------------------------------------------------

  -- subtypes and database type
  SUBTYPE DiscIndex IS Natural RANGE 1..MaxDiscs;
  SUBTYPE DiscRange IS Natural RANGE 0..MaxDiscs;
  TYPE DatabaseType IS ARRAY(DiscIndex) OF Disc;

  -- "abstract data object" for the compact disc database
  Database: DatabaseType;  -- holds the compact disc database
  HowMany : DiscRange;   -- how many records are in database

  PROCEDURE Get (Item: OUT Disc) IS
  BEGIN -- stub
    Ada.Text_IO.Put(Item => "Get is still under construction.");
    Ada.Text_IO.New_Line;
  END Get;

  PROCEDURE Put (Item: IN Disc) IS
  BEGIN -- stub
    Ada.Text_IO.Put(Item => "Put is still under construction.");
    Ada.Text_IO.New_Line;
  END Put;

  PROCEDURE ClearDatabase IS
  BEGIN -- stub  
    Ada.Text_IO.Put(Item => "ReadDatabase is still under construction.");
    Ada.Text_IO.New_Line;
  END ClearDatabase;

  PROCEDURE ReadDatabase IS
  BEGIN -- stub  
    Ada.Text_IO.Put(Item => "ReadDatabase is still under construction.");
    Ada.Text_IO.New_Line;
  END ReadDatabase;

  PROCEDURE WriteDatabase IS
  BEGIN -- stub
    Ada.Text_IO.Put(Item => "WriteDatabase is still under construction.");
    Ada.Text_IO.New_Line;
  END WriteDatabase;

  PROCEDURE FindDisc(Code: IN BarCode; Item: OUT Disc; Success: OUT Boolean) IS
  BEGIN -- stub  -- Find
    Ada.Text_IO.Put(Item => "Find is still under construction.");
    Ada.Text_IO.New_Line;
  END FindDisc;

  PROCEDURE AddDisc (Item: IN Disc; Success: OUT Boolean) IS
  BEGIN -- stub
    Ada.Text_IO.Put(Item => "AddDisc is still under construction.");
    Ada.Text_IO.New_Line;
  END AddDisc;

  PROCEDURE DeleteDisc (Code: IN BarCode; Success: OUT Boolean) IS
  BEGIN -- stub
    Ada.Text_IO.Put(Item => "DeleteDisc is still under construction.");
    Ada.Text_IO.New_Line;
  END DeleteDisc;

  PROCEDURE DisplayDatabase IS
  BEGIN -- stub
    Ada.Text_IO.Put(Item => "DisplayDatabase is still under construction.");
    Ada.Text_IO.New_Line;
  END DisplayDatabase;

END Compact;