示例#1
0
        static void Main()
        {
            Rectangle rectangle = new Rectangle();

            rectangle.GetValue();
            rectangle.Display();
        }
示例#2
0
        static void Main(string[] args)
        {
            Rectangle rect = new Rectangle(15, 20);

            rect.Display();
            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
        }
示例#4
0
        static void Main(string[] args)
        {
            Rectangle r1 = new Rectangle(); //新增房间1,r1是房间1的钥匙
            Rectangle r2 = new Rectangle(); //新增房间2,r2是房间2的钥匙

            //Rectangle r3 = r1;//r3是房间1的钥匙

            r1.Acceptdetails(1.4, 2, "m");
            r2.Acceptdetails(1400, 2000, "mm");

            r1.Display();
            r2.Display();


            if (r1 == r2)
            {
                Console.WriteLine("===================");
            }
            else
            {
                Console.WriteLine("!!!!!!!!!!!!!!!!!!!");
            }

            Console.ReadLine();
        }
示例#5
0
 static void Main(string[] args)
 {
     Rectangle r = new Rectangle();
     r.Acceptdetails();
     r.Display();
     Console.ReadLine();
 }
示例#6
0
        static void main(String[] args)
        {
            int?num2 = 45;

            Rectangle r = new Rectangle();

            r.length = 5;
            r.width  = 2;
            r.Display();
            int max = r.FindMax(r.length, r.width);

            Console.ReadKey();

            r.Factorial(4);

            // Initialization of array
            int [] marks = new int[5] {
                1, 2, 3, 4, 5
            };
            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine("Element {0}: {1}", i, marks[i]);
            }

            foreach (int j in n)
            {
            }
        }
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Display();
            Console.WriteLine("Area: {0}", r.GetArea());
            Console.ReadLine();
        }
示例#8
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.AcceptDetails(3, 4);
            r.Display();
            Console.ReadKey();
        }
示例#9
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
        }
        void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
示例#11
0
        static void Main(string[] args)
        {
            // 实例化一个类型对象
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
示例#12
0
        static void Main(String[] args)
        {
            Rectangle r = new Rectangle();

            r.AcceptDetails();
            r.GetArea();
            r.Display();
            Console.ReadLine();
        }
示例#13
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            Console.WriteLine("Hello World");
            r.Acceptdetails();
            r.Display();
            Console.ReadLine();
        }
        public static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.length = 3.5;
            r.width  = 4.5;
            r.Display();
            Console.ReadLine();
        }
示例#15
0
        static void Main()
        {
            Rectangle r = new Rectangle();

            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.ReadLine();
        }
示例#16
0
        static void Main(string[] args)
        {
            Rectangle myRectangle = new Rectangle();

            myRectangle.UserEntries();
            myRectangle.Display();


            Console.ReadLine();
        }
示例#17
0
        static void Main_encapsulationpublic(string[] args)
        {
            Rectangle r = new Rectangle();

            //can access length, width and methods because all are declared public
            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.ReadLine();
        }
示例#18
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle
            {
                length = 12.5,
                width  = 8.25
            };

            r.Display();
            ReadLine();
        }
示例#19
0
 static void Main(string[] args)
 {
     Rectangle r = new Rectangle();
     //r.Acceptdetails();
     //r.length = 4.5;
     //r.width = 3.5;
     //r.Acceptdetails();
     r.length = 4.5;
     r.width = 3.5;
     r.Display();
     Console.ReadLine();
 }
示例#20
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            r.Acceptdetails();
            r.Display();
            Console.WriteLine("Now comes the triangle. ");
            Triangle t = new Triangle();

            t.GetDetails(10, 30);
            t.Display();
            Console.ReadLine();
        }
示例#21
0
        static void Main(string[] args)
        {
            WriteLine("Hit any key to view the next shape results\n");
            Rectangle r = new Rectangle();
            Triangle  t = new Triangle();
            Square    s = new Square();
            Octagon   o = new Octagon();

            t.Display();
            s.Display();
            r.Display();
            o.Display();
        }
示例#22
0
        static void Main(string[] args)
        {
            Rectangle r = new Rectangle();

            //r.Acceptdetails();
            //r.length = 4.5;
            //r.width = 3.5;
            //r.Acceptdetails();
            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.ReadLine();
        }
示例#23
0
        static void Main(string[] args)
        {
            Console.WriteLine("\n ----Rectangle---- \n");
            Rectangle r = new Rectangle();

            r.length = 4.5;
            r.width  = 3.5;
            r.Display();
            Console.WriteLine("\n ----Triangle---- \n");
            Triangle t = new Triangle();

            t.GetData();
            t.Display();
            Console.WriteLine("\n ----Square---- \n");
            Square s = new Square();

            s.base_l = 10;
            s.height = s.base_l;
            s.Display();
            Console.ReadLine();
        }
示例#24
0
        static void Main(string[] args)
        {
            Rectangle rectangle = new Rectangle(4.5, 4.6);

            rectangle.Display();
        }