Yurttas/PL/OOL/Cplusplus/F/05/01/01/02/id a 00.cpp

From ZCubes Wiki
Revision as of 23:37, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 1998 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Perm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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   i_a_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "I_A.h"
22#include "D_A.h"
23
24int main(int argc, char* argv[]) {
25
26  I_A a;
27
28  cout << "a value after default construction-I_A() /" << endl;
29  cout << a << endl;
30
31  a.set_a0(8);
32  a.set_a1(5);
33
34  cout << "a value after a.set_a0(8) /" << endl;
35  cout << "  value after a.set_a1(8) /" << endl;
36  cout << a << endl;
37
38  I_A b(2);
39
40  cout << "b value after default construction-I_A(2) /" << endl;
41  cout << b << endl;
42
43  I_A c(b);
44
45  cout << "c value after I_A c(b) /" << endl;
46  cout << c << endl;
47
48  b = a;
49
50  cout << "b value after b=a /" << endl;
51  cout << b << endl;
52
53  cout << "b.get_a0() /" << endl;
54  cout << b.get_a0() << endl;
55
56  cout << endl;
57
58  D_A d;
59
60  cout << "d value after default construction-D_A() /" << endl;
61  cout << d << endl;
62
63  d.set_a0(8);
64  d.set_a1(5);
65
66  cout << "d value after a.set_a0(8) /" << endl;
67  cout << "  value after a.set_a1(5) /" << endl;
68  cout << d << endl;
69
70  D_A e(2);
71
72  cout << "e value after default construction-D_A(2) /" << endl;
73  cout << e << endl;
74
75  D_A f(e);
76
77  cout << "f value after D_A f(e) /" << endl;
78  cout << f << endl;
79
80  e = d;
81
82  cout << "e value after e=d /" << endl;
83  cout << e << endl;
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}