Yurttas/PL/OOL/Cplusplus/F/05/01/01/02/t a 22.cpp

From ZCubes Wiki
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   date   : September 1, 1998.
11   author : Salih Yurttas.
12
13   t_a_22.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "T_A.cpp"
22#include "t_aa.cpp"
23
24int main(int argc, char *argv[]) {
25
26  T_A<int> a;
27
28  t_aa("a value after default construction-T_A<int>() /",
29       a);
30
31  a.set_a0(8);
32  a.set_a1(5);
33
34  t_aa("a value after a.set_a0(8) /\n  value after a.set_a1(5) /",
35       a);
36
37  T_A<int> b(2);
38
39  t_aa("b value after default construction-T_A<int>(2) /",
40       a);
41
42  T_A<int> c(b);
43
44  t_aa("c value after T_A<int> c(b) /",
45       c);
46
47  b = a;
48
49  t_aa("b value after b=a /",
50       b);
51
52  cout << "b.get_a0() /" << endl;
53  cout << b.get_a0() << endl;
54  cout << "b.get_a1() /" << endl;
55  cout << b.get_a1() << endl;
56
57  cout << endl;
58
59  T_A<double> d;
60
61  t_aa("d value after default construction-T_A<double>() /",
62       d);
63
64  d.set_a0(8);
65  d.set_a1(5);
66
67  t_aa("d value after d.set_a0(8) /\n  value after d.set_a1(5) /",
68       d);
69
70  T_A<double> e(2);
71
72  t_aa("e value after default construction-T_A<double>(2) /",
73       e);
74
75  T_A<double> f(e);
76
77  t_aa("f value after T_A<double> f(e) /",
78       f);
79
80  e = d;
81
82  t_aa("e value after e=d /",
83       e);
84
85  cout << "e.get_a0() /" << endl;
86  cout << e.get_a0() << endl;
87  cout << "e.get_a1() /" << endl;
88  cout << e.get_a1() << endl;
89
90}