Yurttas/PL/IL/Ada-95/ProgUnits/G/ex 08.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_08.adb
19
20
21with Text_IO; use Text_IO;
22
23with EX_08_P; use EX_08_P;
24
25procedure EX_08 is
26
27 A : Integer := 1;
28 B : Integer := 5;
29
30 X : Float := 2.4;
31 Y : Float := 8.1;
32
33 procedure E_I is new E(Element => Integer);
34 procedure E_F is new E(Element => Float);
35
36begin
37
38 P("A-B before / ", A, B);
39
40 E_I(A, B);
41
42 P("A-B after / ", A, B);
43
44 E_I(A, B);
45
46 New_Line;
47
48 P("X-Y before / ", X, Y);
49
50 E_F(X, Y);
51
52 P("X-Y after / ", X, Y);
53
54 E_F(X, Y);
55
56end EX_08;