static void Main(string[] args)
        {
            Console.WriteLine("Nhap vao chieu dai:");
            cd = int.Parse(Console.ReadLine());
            Console.WriteLine("Nhap vao chieu rong:");
            cr = int.Parse(Console.ReadLine());
            HCN hcn1 = new HCN();

            hcn1.SetHCN(cd, cr);
            Console.WriteLine("Chu vi hcn la:{0}", hcn1.chuvi());
            Console.WriteLine("Dien tich hcn la:{0}", hcn1.dientich());
            Console.ReadLine();
        }
Пример #2
0
        public void TestMethod1()
        {
            double x1       = double.Parse(TestContext.DataRow[0].ToString());
            double y1       = double.Parse(TestContext.DataRow[1].ToString());
            double x2       = double.Parse(TestContext.DataRow[2].ToString());
            double y2       = double.Parse(TestContext.DataRow[3].ToString());
            double expected = double.Parse(TestContext.DataRow[4].ToString());
            Diem   d1       = new Diem(x1, y1);
            Diem   d2       = new Diem(x2, y2);
            HCN    h        = new HCN(d1, d2);
            double actual   = h.TinhDienTich();

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
 public virtual HCN getHCN(HCN hcn)
 {
     return(hcn);
 }