with Currency;
with Dates;
package Employees is
------------------------------------------------------------------
--| Specification for ADT package to handle Employee records
--| Author: Michael B. Feldman, The George Washington University
--| Last Modified: October 1995
------------------------------------------------------------------
-- constant and type definitions
MaxName: constant Positive := 30;
subtype NameType is String(1..30);
subtype IDType is Positive range 1111..9999;
type GenderType is (Female, Male);
type Employee is private;
-- operations
-- constructor
function MakeEmployee (ID: IDType;
Name: NameType;
Gender: GenderType;
NumDepend: Natural;
Salary: Currency.Quantity;
StartDate: Dates.Date) return Employee;
-- Pre: all input parameters are defined
-- Post: returns a value of type Employee
-- selectors
function RetrieveID (OneEmp: Employee) return IDType;
function RetrieveName (OneEmp: Employee) return NameType;
function RetrieveGender (OneEmp: Employee) return GenderType;
function RetrieveNumDepend (OneEmp: Employee) return Natural;
function RetrieveSalary (OneEmp: Employee) return Currency.Quantity;
function RetrieveDate (OneEmp: Employee) return Dates.Date;
-- Pre: OneEmp is defined
-- Post: each selector retrieves its desired field
private
type Employee is record
ID: IDType := IDType'Last;
Name: NameType := (others => ' ');
Gender: GenderType := Female;
NumDepend: Natural := 0;
Salary: Currency.Quantity := Currency.MakeCurrency(0.00);
StartDate: Dates.Date := Dates.MakeDate(1980, 1, 1);
end record;
end Employees;