コード例 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("\n-------Human--------");
            Human human = new Human();

            human.GetInfo();

            Console.WriteLine("\n-------Student--------");
            Student student = new Student();

            student.GetInfo();

            Console.WriteLine("\n-------Faculty Student--------");
            University university = new University();

            Console.WriteLine("\n-------New Student--------");
            university[0] = new FacultyStudent();
            university[0].GetInfo();
            Console.WriteLine("\n-------New Student--------");
            university[1] = new FacultyStudent();
            university[1].GetInfo();

            int  gamecheack = 0;
            Game game;

            game.Start();
            while (gamecheack == 0)
            {
                Console.WriteLine("\n------------------------------------------");
                Console.WriteLine("\nSelect an action\n1.Play one game\n2.Finish the game");
                Console.WriteLine("\n------------------------------------------");
                int cheack = Convert.ToInt32(Console.ReadLine());
                switch (cheack)
                {
                case 1: game.StartGame(university[0].name, university[1].name); break;

                case 2: game.StartGame(); gamecheack = 1; break;
                }
            }

            Console.ReadKey();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Maksim229/labs
            static void Main(string[] args)
            {
                int     time;
                Message mes;

                Console.WriteLine("\nEnter the current hour of time:");
                time = Convert.ToInt32(Console.ReadLine());
                if (time < 12)
                {
                    mes = GoodMorning;
                    mes();
                }
                else if (time > 12)
                {
                    mes = GoodEvening;
                    mes();
                }

                Console.WriteLine("\n-------Human--------");
                Human human = new Human();

                human.GetInfo();

                Console.WriteLine("\n-------Student--------");
                Student student = new Student();

                student.GetInfo();

                Console.WriteLine("\n-------Faculty Student--------");
                University university = new University();

                university[0] = new FacultyStudent();
                university[0].GetInfo();
                Console.WriteLine("\n-------New Student--------");
                university[1] = new FacultyStudent();
                university[1].GetInfo();

                Wastepaper acc = new Wastepaper(100);

                acc.Notify += DisplayMessage;
                acc.Put(100);
                Console.WriteLine($"Macculature at the university: {acc.Sum}");
                acc.Take(70);
                Console.WriteLine($"Сумма на счете: {acc.Sum}");
                acc.Take(180);
                Console.WriteLine($"Macculature at the university: {acc.Sum}");

                int  gamecheack = 0;
                Game game;

                game.Start();
                while (gamecheack == 0)
                {
                    Console.WriteLine("\n------------------------------------------");
                    Console.WriteLine("\nSelect an action\n1.Play one game\n2.Finish the game");
                    Console.WriteLine("\n------------------------------------------");
                    int cheack = Convert.ToInt32(Console.ReadLine());
                    switch (cheack)
                    {
                    case 1: game.StartGame(university[0].name, university[1].name); break;

                    case 2: game.StartGame(); gamecheack = 1; break;
                    }
                }

                Console.ReadKey();
            }