Yurttas/PL/OOL/CS/F/04/01/00/A.cs

Revision as of 08:05, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="csharp" line start="1" enclose="div">/** * Copyright(C) 2003 * All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. * * ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  1/**
  2 *  Copyright(C) 2003
  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, 2003
 11 *  @author : Salih Yurttas
 12 */
 13
 14
 15using System;
 16
 17public class A
 18{
 19  private int i0;
 20
 21  protected int i1;
 22  protected int i2;
 23
 24  public A()
 25  {
 26    i0 = 0;
 27    i1 = 2;
 28    i2 = 4;
 29  }
 30
 31  public A(int i0,
 32           int i1,
 33           int i2)
 34  {
 35    this.i0 = i0;
 36    this.i1 = i1;
 37    this.i2 = i2;
 38  }
 39
 40  public int I0
 41  {
 42    get
 43    {
 44      return i0;
 45    }
 46    set
 47    {
 48      i0 = value;
 49    }
 50  }
 51
 52  public int I1
 53  {
 54    get
 55    {
 56      return i1;
 57    }
 58    set
 59    {
 60      i1 = value;
 61    }
 62  }
 63
 64  public int I2
 65  {
 66    get
 67    {
 68      return i2;
 69    }
 70    set
 71    {
 72      i2 = value;
 73    }
 74  }
 75
 76  public virtual int MA1()
 77  {
 78    if(i1<=i2)
 79      return i1;
 80    else
 81      return i2;
 82  }
 83
 84  public virtual void MA2(int i)
 85  {
 86    i1 += i;
 87    i2 -= i;
 88  }
 89
 90  public void Output()
 91  {
 92    Console.WriteLine();
 93
 94    Console.WriteLine(i0);
 95    Console.WriteLine(i1);
 96    Console.WriteLine(i2);
 97
 98    Console.WriteLine();
 99  }
100}