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