Beispiel #1
0
        public static void SelectionMatter()
        {
            matter = Console.ReadLine();
            string[]   linesMath     = File.ReadAllLines(@"\math.txt");
            string[]   linesHistory  = File.ReadAllLines(@"\history.txt");
            ItemAnswer ex_ItemAnswer = new ItemAnswer();

            switch (matter)
            {
            case "Math":
            case "math":
                for (int i = 0; i < linesMath.Length; i += 4)
                {
                    ex_ItemAnswer.item      = linesMath[i];
                    ex_ItemAnswer.answer    = linesMath[i + 1];
                    ex_ItemAnswer.itemPoint = Convert.ToInt32(linesMath[i + 2]);
                    ex_ItemAnswer.CheckAnswer();
                    Console.WriteLine("");
                }
                break;

            case "History":
            case "history":
                for (int i = 0; i < linesHistory.Length; i += 4)
                {
                    ex_ItemAnswer.item      = linesHistory[i];
                    ex_ItemAnswer.answer    = linesHistory[i + 1];
                    ex_ItemAnswer.itemPoint = Convert.ToInt32(linesHistory[i + 2]);
                    ex_ItemAnswer.CheckAnswer();
                    Console.WriteLine("");
                }
                break;
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello the entrant, pass the test and you will be enlisted!");
            Console.WriteLine("Enter the subject!");
            Console.WriteLine("-Math");
            Console.WriteLine("-History");

            Matter.SelectionMatter();
            ItemAnswer.Procent();
            Console.WriteLine("Test Result = " + ItemAnswer.answerPerent + "%");
            Result.ResultTest();
            Console.WriteLine(Result.resultTest);
            /*-------------------*/
            Console.ReadLine();
        }