Difference between revisions of "Yurttas/PL/IL/Ada-95/F/03/02/00/complex 02.adb"
Jump to navigation
Jump to search
(Created page with "<syntaxhighlight lang="ada" line start="1" enclose="div">-- -- Copyright(C) 1998 -- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. -- -- Permis...") |
(No difference)
|
Latest revision as of 05:15, 5 November 2013
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 : January 1, 1998.
12-- author : Salih Yurttas.
13
14-- purpose : Complex abstract data type object usage.
15
16-- complex_02.adb
17
18
19with Ada.Text_IO;
20use Ada.Text_IO;
21
22with Complex_02_P;
23
24procedure Complex_02 is
25
26 package Cmplx is new Complex_02_P(Float);
27 use Cmplx;
28
29 A,
30 B : Float;
31
32 C,
33 D,
34 E : Complex;
35
36begin
37
38 Put_Complex(C);
39
40 Put_Complex(D);
41
42 Put_Complex(E);
43
44 New_Line;
45
46 A := 2.0;
47 B := 4.0;
48 C := Assemble(A,B);
49
50 Put_Complex(C);
51
52 New_Line;
53
54 D := Assemble(B,A);
55
56 Put_Complex(D);
57
58 New_Line;
59
60 E := C+D;
61
62 Put_Complex(E);
63
64end Complex_02;