Esempio n. 1
0
        public static void GenerateRandomComputation(int questions, string response, int currQues)
        {
            student.Current_Question = currQues;

            if (random != null)
            {
                num1 = random.Next(0, 9);
                num2 = random.Next(0, 9);

                do
                {
                    helper.DisplayMessage($"\n\n{num1} \n+ \n{num2} \n={num1 + num2}");
                    contr_var++;
                } while (response.Equals('y') && currQues <= questions);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            if (args != null)
            {
                int index = 0;

                Initialize();

                UserDisplay();

                helper.DisplayMessage($"Please enter your Name: ");
                student.Name = ReadLine();

                helper.DisplayMessage($"\nPlease enter your last Name: ");
                student.Surname = ReadLine();

                helper.DisplayMessage($"\n{UserModeSelection()}");
                student.Mode = ToInt32(ReadLine());

                helper.DisplayMessage($"\n{NumberOfQuestionsSelected()}");
                student.NumOfQuestSelected = ToInt32(ReadLine());
                numOfQuest = student.NumOfQuestSelected;


                helper.DisplayMessage("$\nPlease select your grade:\nGrade 1\nGrade 2\nGrade 3\nGrade 12");
                int user_response = ToInt32(ReadLine());

                switch (user_response)
                {
                case 1:
                    RedirectToSelectedOption(1);
                    break;

                case 2:
                    RedirectToSelectedOption(2);
                    break;

                case 3:
                    RedirectToSelectedOption(3);
                    break;

                case 4:
                    RedirectToSelectedOption(12);
                    break;

                default:
                    break;;
                }

                helper.DisplayMessage($"\nPlease select your desired operation:");

                foreach (int i in Enum.GetValues(typeof(Operation)))
                {
                    helper.DisplayMessage($"{Enum.GetName(typeof(Operation), i)}");

                    index = i;
                }

                RetrieveUserSelectedOption(ToInt32(ReadLine()));

                switch (student.Mode)
                {
                case 1:
                    OnDetailsCaptured(student);
                    GradeInspector(student.GradeLevel);
                    break;

                case 2:
                    OnDetailsCaptured(student);
                    GradeInspector(student.GradeLevel);
                    break;

                default:
                    break;
                }
            }
        }