Yurttas/PL/IL/Ada-95/F/04/00/01/complex 00.adb

 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-- complex_00.adb
15
16
17with Ada.Text_IO;
18use Ada.Text_IO;
19
20with Ada.Float_Text_IO;
21use Ada.Float_Text_IO;
22
23with Complex_P;
24use Complex_P;
25
26with Complex_P.Polar_P;
27use Complex_P.Polar_P;
28
29procedure Complex_00 is
30
31  C1,
32  C2,
33  C3  : Complex;
34 
35begin
36  
37  C1 := Construct(5.6, 2.0);
38
39  C2 := Construct(2.4, 1.7);
40
41  C1 := C1 + C2;
42
43  C3 := C1 - C2;
44
45  C2 := C1 * C3;
46
47  Put("Number 1's real part is:  ");
48  Put(Real_Part(C1), 1);
49
50  New_Line;
51
52  Put("Number 1's imaginary part is:  ");
53  Put(Imaginary_Part(C1), 1);
54
55  New_Line(2);
56
57  Put("Number 2's real part is:  ");
58  Put(Real_Part(C2), 1);
59
60  New_Line;
61
62  Put("Number 2's imaginary part is:  ");
63  Put(Imaginary_Part(C2), 1);
64
65  New_Line(2);
66
67  Put("Number 3's real part is:  ");
68  Put(Real_Part(C3), 1);
69
70  New_Line;
71
72  Put("Number 3's imaginary part is:  ");
73  Put(Imaginary_Part(C3), 1);
74
75end Complex_00;