Yurttas/PL/OOL/Cplusplus/F/03/02/06/01/i 00.cpp
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 : January 1, 1998.
11 author : Salih Yurttas.
12
13 i_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "I.h"
22
23int main(int argc, char *argv[]) {
24
25 I i_0;
26
27 cout << "initial values after default construction-I() /" << endl;
28 cout << "i_0 :" << endl;
29 cout << i_0 << endl;
30 cout << endl;
31
32 I i_1(2);
33
34 cout << "initial values after default construction-I() /" << endl;
35 cout << "i_1 :" << endl;
36 cout << i_1 << endl;
37 cout << endl;
38
39 I i_2(i_1);
40
41 cout << "initial values after copy construction-I(const I&) /" << endl;
42 cout << "i_2 :" << endl;
43 cout << i_2 << endl;
44 cout << endl;
45
46 cout << "i_1 :" << endl;
47 cout << i_1 << endl;
48 cout << endl;
49
50 I i_3;
51
52 cout << "initial values after default construction-I() /" << endl;
53 cout << "i_3 :" << endl;
54 cout << i_3 << endl;
55 cout << endl;
56
57 i_3 = i_0;
58
59 cout << "values after i_3 = i_0 /" << endl;
60 cout << "i_3 :" << endl;
61 cout << i_3 << endl;
62 cout << endl;
63
64 cout << "i_0 :" << endl;
65 cout << i_0 << endl;
66 cout << endl;
67
68 i_3 = i_1;
69
70 cout << "values after i_3 = i_1 /" << endl;
71 cout << "i_3 :" << endl;
72 cout << i_3 << endl;
73 cout << endl;
74
75 cout << "i_1 :" << endl;
76 cout << i_1 << endl;
77 cout << endl;
78
79 i_3 = i_3;
80
81 cout << "values after i_3 = i_3 /" << endl;
82 cout << "i_3 :" << endl;
83 cout << i_3 << endl;
84 cout << endl;
85
86 cout << "i_3 :" << endl;
87 cout << i_3 << endl;
88 cout << endl;
89
90 i_3 = i_1 + i_2;
91
92 cout << "values after i_3 = i_1+i_2 /" << endl;
93 cout << "i_3 :" << endl;
94 cout << i_3 << endl;
95 cout << endl;
96 cout << "i_1 :" << endl;
97 cout << i_1 << endl;
98 cout << endl;
99 cout << "i_2 :" << endl;
100 cout << i_2 << endl;
101 cout << endl;
102
103 cout << "values before ++i_3 /" << endl;
104 cout << "i_3 :" << i_3 << endl;
105 cout << endl;
106
107 ++i_3;
108
109 cout << "values after ++i_3 /" << endl;
110 cout << "i_3 :" << i_3 << endl;
111 cout << endl;
112
113 cout << "values before i_2++ /" << endl;
114 cout << "i_2 :" << i_2 << endl;
115 cout << endl;
116
117 cout << "values after i_2++ /" << endl;
118 cout << "i_2 :" << i_2++ << endl;
119 cout << endl;
120
121 cout << "values after i_2++ /" << endl;
122 cout << "i_2 :" << i_2 << endl;
123 cout << endl;
124
125 --i_3;
126
127 cout << "values after --i_3 /" << endl;
128 cout << "i_3 :" << i_3 << endl;
129 cout << endl;
130
131 cout << "values before i_2-- /" << endl;
132 cout << "i_2 :" << i_2 << endl;
133 cout << endl;
134
135 cout << "values after i_2-- /" << endl;
136 cout << "i_2 :" << i_2-- << endl;
137 cout << endl;
138
139 cout << "values after i_2-- /" << endl;
140 cout << "i_2 :" << i_2 << endl;
141 cout << endl;
142
143 bool b;
144
145 b = (i_3==i_3);
146
147 cout << "truth for i_3==i_3 /" << endl;
148 cout << b << endl;
149 cout << endl;
150
151 b = (i_3==i_1);
152
153 cout << "truth for i_3==i_1 /" << endl;
154 cout << b << endl;
155 cout << endl;
156
157 b = (i_3==i_2);
158
159 cout << "truth for i_3==i_2 /" << endl;
160 cout << b << endl;
161 cout << endl;
162
163}