Esempio n. 1
0
        public static void choncahai(int sl, int sl2, ref int sovethuong2, ref int sovevip2)
        {
            Vethuong      vethuong2 = new Vethuong();
            List <string> xx        = vethuong2.layslvethuong2();
            Vevip         vevip2    = new Vevip();
            List <string> yy        = vevip2.layslvevip2();

            Ve[] ch = new Ve[sl + sl2];
            int  i, j = 0;

            for (i = 0; i < sl + sl2; i++)
            {
                ch[i]       = new Vethuong();
                ch[i].Mave  = xx.ElementAt(i);
                ch[i].Giave = ch[i].gangiave();
                ch[i].Daban = true;
            }
            for (i = sl; i < sl + sl2; i++)
            {
                ch[i]       = new Vevip();
                ch[i].Mave  = yy.ElementAt(j);
                ch[i].Giave = ch[j].gangiave();
                ch[i].Daban = true;
                j++;
            }
            sovevip2    = j;
            sovethuong2 = ch.Length - sovevip2;
        }
Esempio n. 2
0
        public static void Hienthiveconlai(ref int sovethuong, ref int sovevip)
        {
            Vethuong vethuong = new Vethuong();
            Vevip    vevip    = new Vevip();
            int      a        = vethuong.slveconlai(sovethuong) + vevip.slconlai(sovevip);

            Console.WriteLine("So luong ve con lai la : {0}", a);
            Console.WriteLine("So luong ve da ban la : {0}", sovethuong + sovevip);
        }
Esempio n. 3
0
        public void layDsve()
        {
            Console.WriteLine("Gia ve vip: 200$");
            Vevip vip = new Vevip();

            Console.WriteLine("so luong ve vip: {0}", vip.layslvevip2().Count);
            Console.WriteLine("Gia ve thuong: 100$");
            Vethuong thuong = new Vethuong();

            Console.WriteLine("So luong ve thuong: {0}", thuong.layslvethuong2().Count);
            Console.WriteLine();
        }
Esempio n. 4
0
        public static void chonvevip(int sl, ref int sovevip2)
        {
            Vevip[]       vv     = new Vevip[sl];
            Vevip         vevip2 = new Vevip();
            List <string> yy     = vevip2.layslvevip2();

            for (int i = 0; i < sl; i++)
            {
                vv[i]       = new Vevip();
                vv[i].Mave  = yy.ElementAt(i);
                vv[i].Giave = vv[i].gangiave();
                vv[i].Daban = true;
            }
            sovevip2 = vv.Length;
        }
Esempio n. 5
0
        public static string invedaban(int sovethuong, int sovevip)
        {
            if (sovethuong != 0 && sovevip == 0)
            {
                Vethuong      vethuong = new Vethuong();
                List <string> mave     = vethuong.layslvethuong2();
                string        inve     = "";

                for (int i = 0; i < sovethuong; i++)
                {
                    inve = inve + mave.ElementAt(i) + "    ";
                }
                return(inve);
            }

            else if (sovethuong == 0 && sovevip != 0)
            {
                Vevip         vevip = new Vevip();
                List <string> mave  = vevip.layslvevip2();
                string        inve  = "";
                for (int i = 0; i < sovevip; i++)
                {
                    inve = inve + mave.ElementAt(i) + "    ";
                }
                return(inve);
            }
            else
            {
                Vethuong      vethuong = new Vethuong();
                List <string> mave1 = vethuong.layslvethuong2();
                Vevip         vevip = new Vevip();
                List <string> mave2 = vevip.layslvevip2(); string inve = "";
                int           i, j = 0;
                for (i = 0; i < sovethuong; i++)
                {
                    inve = inve + mave1.ElementAt(i) + "    ";
                }
                for (i = sovethuong; i < sovethuong + sovevip; i++)
                {
                    inve = inve + mave2.ElementAt(j) + "   "; j++;
                }
                return(inve);
            }
        }