Beispiel #1
0
        static void Main(string[] args)
        {
            //input
            RetrieveData.ReadFileData();
            RetrieveData.DisplayData(false); // change to true to see red data from .txt

            ExamData ed = new ExamData();

            string answers = ed.GetAnswerLine();

            string[] studId  = ed.GetStudntId();
            string[] studAns = ed.GetStudntAnswers();

            //logic
            Console.WriteLine(" ********* MCQ STUDENT EXAM REPORT ********* ");
            int[] score = CountCorrectAnswer(answers, studAns);
            //output #1 Print student id and their score
            ShowStudScore(studId, score);
            //output #2 Print total candidate number
            Console.WriteLine("The total amount of eximninations marked : " + ShowTotalCandidates(studId));
            //output #3 Print the correct answer for each question
            ShowCorrectAnswerForQuestion();

            Console.ReadKey();
        }
Beispiel #2
0
            static public void DisplayData(bool showThis)
            {
                ExamData ed = new ExamData();

                string[] studentID      = ed.GetStudntId();
                string[] studentAnswers = ed.GetStudntAnswers();
                string   answerLine     = ed.GetAnswerLine();
                int      size           = studentID.Length;

                if (showThis == true)
                {
                    Console.WriteLine("\n>>>Answer line: " + answerLine + " ");

                    for (int i = 1; i < size - 1; i++)
                    {
                        Console.WriteLine(i + ") \n" +
                                          "Student id: " + studentID[i] +
                                          "\nAnswers:    " + studentAnswers[i]);
                    }
                }
            }