Yurttas/PL/OOL/Cplusplus/F/04/01/01/02/s 00.cpp

 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   s_00.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "P.h"
22#include "R.h"
23#include "S.h"
24
25int main(int argc, char* argv[]) {
26
27  P p1;
28
29  cout << "initial values after default construction-P() /";
30  cout << endl;
31  cout << p1;
32  cout << endl;
33
34  p1.i0 = 1;
35  p1.set_i1(2);
36  p1.set_i2(4);
37
38  cout << "accessors after mutators /";
39  cout << endl;
40
41  cout << p1.i0;
42  cout << endl;
43
44  cout << p1.get_i1();
45  cout << endl;
46
47  cout << p1.get_i2();
48  cout << endl;
49
50  cout << endl;
51  cout << "p1 /";
52  cout << endl;
53  cout << p1;
54  cout << endl;
55
56  R r1;
57
58  cout << "initial values after default construction-R() /";
59  cout << endl;
60  cout << r1;
61  cout << endl;
62
63  r1.set_i3(1);
64
65  cout << "accessors after mutators /";
66  cout << endl;
67
68  cout << r1.get_i3();
69  cout << endl;
70
71  cout << endl;
72  cout << "r1 /";
73  cout << endl;
74  cout << r1;
75  cout << endl;
76
77  S s1;
78
79  cout << "initial values after default construction-S() /";
80  cout << endl;
81  cout << s1;
82  cout << endl;
83
84  s1.set_i4(1);
85
86  cout << "accessors after mutators /";
87  cout << endl;
88
89  cout << s1.get_i4();
90  cout << endl;
91
92  cout << endl;
93  cout << "s1 /";
94  cout << endl;
95  cout << s1;
96
97}