示例#1
0
        static void Main(string[] args)
        {
            Student s = new Student("Aibar", "18BD110838");//испльзуем конструктор, придаем значения каждому параметру

            s.Increment();
            Console.WriteLine(s);
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            int     year = int.Parse(Console.Readline());
            Student st1  = new Student("sss", "1234567"); //creating the instance of the class Student

            st1.print();                                  //accessing name and id
            st1.Increment(year);                          //accessing the increased year of study
        }
示例#3
0
文件: Program.cs 项目: eveningqwq/PP2
        static void Main(string[] args)
        {
            Student F = new Student("Dio", "18ZX1234567");

            Console.WriteLine(F.GetName() + " " + F.GetId());
            F.Increment();
            Console.WriteLine(F.GetYear());
        }
示例#4
0
文件: Program.cs 项目: ynurtayev/PP2
        static void Main(string[] args)
        {
            Student F = new Student("Yerzhan", "18BD141312");

            Console.WriteLine(F.GetName() + " " + F.GetId());
            F.Increment();
            Console.WriteLine(F.GetYear());
            Console.ReadKey();
        }
示例#5
0
        static void Main(string[] args)
        {
            Student s = new Student("Yerlan", "18BD110739"); //  создаем обьект класса Студент

            s.YearofStudy = 1;                               //  по умолчанию значение равно 1

            s.Increment();                                   //  после мметода значение инкрементируется (+1), то есть равно 2

            Console.WriteLine(s.YearofStudy);                //  Показываю, что метод Increment работает (Вывод: 2)
        }
示例#6
0
        static void Main(string[] args)
        {
            Student st1 = new Student("aaa", "18BDxxxxxx"); //creating new Student within a class
            string  s   = Console.ReadLine();
            int     n   = int.Parse(s);

            st1.Print();       //accessing name and id
            st1.Increment(n);  //accessing increased year of study
            Console.ReadKey(); ////quiting the program by pressing any key (otherwise it closes immediately)
        }
示例#7
0
文件: Program.cs 项目: Muragul/PP2
        static void Main(string[] args)
        {
            string  name = Console.ReadLine();    //считываем имя с консоли
            string  id   = Console.ReadLine();    //считываем ID
            Student s    = new Student(name, id); //создаем экземпляр нового типа

            s.PrintInfo();                        //выводим информацию за 1 год
            s.Increment();                        //увеличится год обучения
            s.PrintInfo();                        //выводим информацию за следующий год
            Console.ReadKey();                    //ждем нажатия клавиши пользователем
        }
示例#8
0
        static void Main(string[] args)
        {
            string name = Console.ReadLine();  // reading name
            string id   = Console.ReadLine();  // reading id

            Student s = new Student(name, id); //creating an example pf the structure Student


            s.PrintInfo();     //calling the method of printing information

            s.Increment();
            s.PrintInfo();
            Console.ReadKey();
        }