Yurttas/PL/OOL/Cplusplus/F/05/01/02/03/i d a 00.cpp

From ZCubes Wiki
Revision as of 22:40, 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   : January 1, 1998.
11   author : Salih Yurttas.
12
13   i_d_a_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "I_D_A.h"
22
23int main(int argc, char* argv[]) {
24
25  I_D_A a_0;
26
27  cout << "a_0 values after construction-I_D_A() /" << endl;
28  cout << a_0 << endl;
29  cout << endl;
30
31  a_0.set_i_a(2);
32
33  cout << "a_0 values after a_0.set_i_a(2) /" << endl;
34  cout << a_0 << endl;
35  cout << endl;
36
37  a_0.set_i_d(4,
38              3,
39              0.25);
40
41  cout << "a_0 values after a_0.set_d(4,3,0.25) /" << endl;
42  cout << a_0 << endl;
43  cout << endl;
44
45  int n = a_0.get_s();
46
47  int* aa = new int[n];
48
49  aa = a_0.get_i_a();
50
51  cout << "aa after a_0.get_i_a() /" << endl;
52  for(int i=0; i<n; ++i)
53    cout << aa[i] << endl;
54
55  cout << endl;
56
57  I_D_A a_1(a_0);
58
59  cout << "a_1 values after construction-I_D_A(const I_D_A&) /" << endl;
60  cout << a_1 << endl;
61  cout << endl;
62
63  a_1.set_i_d(3,
64              7,
65              2.15);
66
67  cout << "a_1 after updated by (3,7,2.15) /" << endl;
68  cout << a_1 << endl;
69  cout << endl;
70
71  a_1 = a_0;
72
73  cout << "a_1 after a_1=a_0 /" << endl;
74  cout << a_1 << endl;
75  cout << endl;
76
77  cout << "a_0 after a_1=a_0 /" << endl;
78  cout << a_0 << endl;
79  cout << endl;
80
81}