Yurttas/PL/OOL/CS/F/03/00/20/01/A.cs

  1/**
  2 *  Copyright(C) 2006
  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, 2006.
 11 *  authorĀ : Salih Yurttas.
 12 *
 13 *  A.cs
 14 */
 15
 16
 17using System;
 18using System.Collections;
 19
 20public class A : IA
 21{
 22  private int sa1;
 23  private ArrayList a1;
 24
 25  private int sa2;
 26  private string a2;
 27
 28  public int SA1
 29  {
 30    get
 31    {
 32      return a1.Count;
 33    }
 34  }
 35 
 36  public ArrayList A1
 37  {
 38    get
 39    {
 40      return a1;
 41    }
 42
 43    set
 44    {
 45      a1 = value;
 46    }
 47  }
 48
 49  public int SA2
 50  {
 51    get
 52    {
 53      return a2.Length;
 54    }
 55  }
 56 
 57  public string A2
 58  {
 59    get
 60    {
 61      return a2;
 62    }
 63
 64    set
 65    {
 66      a2 = value;
 67    }
 68  }
 69
 70  public A()
 71  {
 72    sa1 = 2;
 73    a1 = new ArrayList();
 74
 75    for(int i=0; i<sa1; ++i)
 76      a1.Add(1);
 77
 78    sa2 = 4;
 79    a2 = new string('y',sa2);
 80  }
 81
 82  public A(int sa1,
 83           int[] vi,
 84           int sa2,
 85           char vc)
 86  {
 87    this.sa1 = sa1;
 88    ArrayList a1 = new ArrayList();
 89
 90    for(int i=0; i<sa1; ++i)
 91      a1.Add(vi[i]);
 92
 93    this.sa2 = sa2;
 94
 95    a2 = new string(vc,this.sa2);
 96  }
 97
 98  public void Output()
 99  {
100    foreach(int i in a1)
101      Console.WriteLine(i);
102   
103    Console.WriteLine(a2);
104    Console.WriteLine();
105  }
106}