Esempio n. 1
0
        static void Main()
        {
            StudentSystem studentSystem = new StudentSystem();
            string        input         = Console.ReadLine();

            while (input != "Exit")
            {
                string[] args    = input.Split();
                var      command = args[0];
                var      name    = args[1];

                switch (command)
                {
                case "Create":
                    var age   = int.Parse(args[2]);
                    var grade = double.Parse(args[3]);
                    studentSystem.Create(name, age, grade);
                    break;

                case "Show":
                    studentSystem.Show(name);
                    break;

                case "Exit":
                    Environment.Exit(0);
                    break;

                default:
                    break;
                }
                input = Console.ReadLine();
            }
        }
Esempio n. 2
0
 public void Action(string[] commandArr)
 {
     if (commandArr[0] == "Create")
     {
         studentSystem.Create(commandArr[1], commandArr[2], commandArr[3]);
     }
     else if (commandArr[0] == "Show")
     {
         string name = commandArr[1];
         studentSystem.Show(name);
     }
 }
Esempio n. 3
0
        static void Main()
        {
            StudentSystem studentSystem = new StudentSystem();

            while (true)
            {
                string[] args = Console.ReadLine().Split();

                if (args[0] == "Create")
                {
                    studentSystem.Create(args);
                }
                else if (args[0] == "Show")
                {
                    studentSystem.Show(args);
                }
                else if (args[0] == "Exit")
                {
                    studentSystem.Exit();
                }
            }
        }