Thứ Bảy, 4 tháng 9, 2010

C Sharp

Nhãn :

using System;
namespace RectangleApplication
{
    class Rectangle
    {
        // member variables
        double length;
        double width;
        public void Acceptdetails()
        {
            length = 4.5;    
            width = 3.5;
        }
        public double GetArea()
        {
            return length * width;
        }
        public void Display()
        {
            Console.WriteLine("Length: {0}", length);
            Console.WriteLine("Width: {0}", width);
            Console.WriteLine("Area: {0}", GetArea());
        }
    }
    
    class ExecuteRectangle
    {
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();
            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
    }
}

Bạn Đang Xem Video Tại Blog http://dothanhdu.blogspot.com
::--> Bạn đang xem Video trên blog http://dothanhdu.blogspot.com --::-- Xin vui lòng nhấn nút Comment để đưa ra những thắc mắc và phản hồi. Chúc bạn có được những giây phúc thư giãn vui vẻ tại đây... :) |

0 nhận xét:

Đăng nhận xét