Yurttas/PL/IL/Ada-95/ProgUnits/G/ex 09.adb
Jump to navigation
Jump to search
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
12-- date : January 1, 1998.
13-- author : Salih Yurttas.
14
15-- purpose : to demonstrate a procedure structure with packages
16-- in Ada-95 programming structuring and composition.
17
18-- ex_09.adb
19
20
21with Text_IO; use Text_IO;
22
23with EX_09_P; use EX_09_P;
24with EX_19_P; use EX_19_P;
25
26procedure EX_09 is
27
28 A : Integer := 1;
29 B : Integer := 5;
30
31 procedure E_I is new E(Element => Integer);
32
33 X : Float := 2.4;
34 Y : Float := 8.1;
35
36 procedure E_F is new E(Element => Float);
37
38begin
39
40 P("A-B before / ", A, B);
41
42 E_I(A, B);
43
44 P("A-B after / ", A, B);
45
46 E_I(A, B);
47
48 New_Line;
49
50 P("X-Y before / ", X, Y);
51
52 E_F(X, Y);
53
54 P("X-Y after / ", X, Y);
55
56 E_F(X, Y);
57
58end EX_09;