1--
2-- Copyright(C) 1998
3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4--
5-- Permission to use, copy, modify, and distribute this
6-- software and its documentation for EDUCATIONAL purposes
7-- and without fee is hereby granted provided that this
8-- copyright notice appears in all copies.
9--
10
11-- date : September 1, 1999.
12-- authorĀ : Salih Yurttas.
13-- adapted from John English's book.
14
15-- class_accounts_ltd.adb
16
17
18package body Class_Account_Ltd is
19
20 procedure Withdraw(The : in out Account_Ltd;
21 Amount : in PMoney;
22 Get : out PMoney) is
23 begin
24 if The.Withdrawals > 0 then -- Not limit
25 The.Withdrawals := The.Withdrawals - 1;
26 Withdraw(Account(The),
27 Amount,
28 Get); -- In Account
29 else
30 Get := 0.00; -- Sorry
31 end if;
32 end Withdraw;
33
34 procedure Reset(The : in out Account_Ltd) is
35 begin
36 The.Withdrawals := WITHDRAWALS_IN_A_WEEK;
37 end Reset;
38
39end Class_Account_Ltd;