Yurttas/PL/OOL/Cplusplus/F/05/01/01/03/D I A.cpp

From ZCubes Wiki
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   D_I_A.cpp
14*/
15
16
17#include "D_I_A.h"
18
19D_I_A::
20D_I_A(const double v1,
21      const int v2) : a0(v1),
22                      a1(v2) {
23}
24
25D_I_A::
26D_I_A(const D_I_A& a) : a0(a.a0),
27                        a1(a.a1) {
28}
29
30D_I_A&
31D_I_A::
32operator=(const D_I_A& a) {
33  a0 = a.a0;
34  a1 = a.a1;
35  return *this;
36}
37
38double
39D_I_A::
40get_a0() const {
41  return a0;
42}
43
44int
45D_I_A::
46get_a1() const {
47  return a1;
48}
49
50void
51D_I_A::
52set_a0(const double v) {
53  a0 = v;
54}
55
56void
57D_I_A::
58set_a1(const int v) {
59  a1 = v;
60}
61
62ostream&
63operator<<(ostream& os,
64           const D_I_A& a) {
65  os << a.a0 << endl;
66  os << a.a1 << endl;
67  os << endl;
68
69  return os;
70}