Beispiel #1
0
        static void Main(string[] args)
        {
            Table [] tables = new Table[10];
            for (int i = 0; i < 5; i++)
            {
                Random random = new Random();
                int    height = random.Next(50, 100);
                int    width  = random.Next(50, 100);
                Table  Obj    = new Table(height, width);
                tables[i] = Obj;
            }
            for (int j = 5; j < 10; j++)
            {
                Random      random = new Random();
                int         height = random.Next(60, 120);
                int         width  = random.Next(60, 120);
                CoffeeTable ct     = new CoffeeTable(height, width);
                tables[j] = ct;
            }
            tables[1].AddLeg();

            for (int i = 0; i < 10; i++)
            {
                tables[i].ShowData();
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            CoffeeTable ct = new CoffeeTable(10, 5);

            ct.ShowData();

            Table[] mytables = new Table[10];
            Random  random   = new Random();

            for (int i = 0; i < 5; i++)
            {
                mytables[i] = new Table(random.Next(50, 201), random.Next(50, 201));
                mytables[i].ShowData();
            }
            for (int i = 5; i < 10; i++)
            {
                mytables[i] = new CoffeeTable(random.Next(40, 121), random.Next(40, 121));
                mytables[i].ShowData();
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            int i;

            Tables[] tables = new Tables[10];
            Random   random = new Random();

            for (i = 0; i < 10; i++)
            {
                tables[i] = new Tables(random.Next(50, 201), random.Next(50, 201));
                tables[i].ShowData();
            }
            CoffeeTable coffeeTable = new CoffeeTable();

            coffeeTable.Display();
            CoffeeTable[] coffeeTables = new CoffeeTable[5];

            for (i = 0; i < 10; i++)
            {
                coffeeTables[i] = new CoffeeTable(random.Next(40, 120), random.Next(40, 120));
            }
            coffeeTables[i].ShowData();
        }