Yurttas/PL/OOL/Cplusplus/F/03/01/01/00/A.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   A.cpp
14*/
15
16
17#include "A.h"
18
19A::
20A() : i1(2),
21      i2(4) {
22}
23
24A::
25A(const int i) : i1(i),
26                 i2(2*i) {
27}
28
29A::
30A(const A& a) : i1(a.i1),
31                i2(a.i2) {
32}
33
34int
35A::
36get_i1() const {
37  return i1;
38}
39
40int
41A::
42get_i2() const {
43  return i2;
44}
45
46void
47A::
48set_i1_i2(const int i) {
49  i1=i;
50  i2=i;
51}
52
53ostream& operator<<(ostream& os,
54                    const A& a) {
55  os << endl;
56  os << a.i1 << endl;
57  os << a.i2 << endl;
58  os << endl;
59
60  return os;
61}