コード例 #1
0
        public DaThuc(int soLuongDonThuc)
        {
            dathuc = new DonThuc[soLuongDonThuc];
            this.soLuongDonThuc = soLuongDonThuc;

            for (int i = 0; i < soLuongDonThuc; i++)
            {
                this[i] = new DonThuc();
            }
        }
コード例 #2
0
 public void khoiTaoDaThuc()
 {
     for (int i = 0; i < this.soLuongDonThuc; i++)
     {
         DonThuc nDonThuc = this[i];
         nDonThuc.soMu = i;
         Console.Write("Nhap He So A cho Don Thuc: ");
         nDonThuc.heSoA = double.Parse(Console.ReadLine());
     }
 }
コード例 #3
0
        public void XuLyGiaTri(int x)
        {
            double reSult = 0;

            for (int i = 0; i < this.soLuongDonThuc; i++)
            {
                DonThuc nDonThuc = this[i];
                reSult += nDonThuc.heSoA * Math.Pow(x, nDonThuc.soMu);
            }
            Console.WriteLine("Gia Tri Cua Da Thuc La: " + reSult);
        }
コード例 #4
0
 public void printDaThuc()
 {
     Console.WriteLine("#####In Da Thuc#####");
     for (int i = 0; i < this.soLuongDonThuc; i++)
     {
         DonThuc nDonThuc = this[i];
         Console.Write(nDonThuc.heSoA + "*" + "x^" + nDonThuc.soMu);
         if (i != this.soLuongDonThuc - 1)
         {
             Console.Write(" + ");
         }
     }
 }
コード例 #5
0
 public DaThuc()
 {
     dathuc    = new DonThuc[1];
     dathuc[0] = new DonThuc();
 }