Difference between revisions of "Yurttas/PL/IL/Ada-95/F/03/02/00/complex 00.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_00.adb
17
18
19with Ada.Text_IO;
20use Ada.Text_IO;
21
22with Complex_00_P;
23use Complex_00_P;
24
25procedure Complex_00 is
26
27 package Flo_IO is new Float_IO(Float);
28 use Flo_IO;
29
30 A,
31 B : Float;
32
33 C,
34 D,
35 E : Complex;
36
37begin
38
39 Put(Real_Part(C));
40 Put(Imaginary_Part(C));
41 New_Line;
42
43 Put(Real_Part(D));
44 Put(Imaginary_Part(D));
45 New_Line;
46
47 Put(Real_Part(E));
48 Put(Imaginary_Part(E));
49 New_Line;
50
51 New_Line;
52
53 A := 2.0;
54 B := 4.0;
55 C := Assemble(A,B);
56
57 Put(Real_Part(C));
58 Put(Imaginary_Part(C));
59 New_Line;
60
61 New_Line;
62
63 D := Assemble(B,A);
64
65 Put(Real_Part(D));
66 Put(Imaginary_Part(D));
67 New_Line;
68
69 New_Line;
70
71 E := C+D;
72
73 Put(Real_Part(E));
74 Put(Imaginary_Part(E));
75 New_Line;
76
77end Complex_00;