示例#1
0
        public static void Main()
        {
            MiscellaniousQuestions q1 = new MiscellaniousQuestions();

            q1.prompt  = "What color is the sky?";
            q1.choices = new List <string> {
                "orange", "lime green", "blue"
            };
            q1.correctAnswer = new List <string> {
                "blue"
            };

            MiscellaniousQuestions q2 = new MiscellaniousQuestions();

            q2.prompt  = "Earth has one moon";
            q2.choices = new List <string> {
                "true", "false"
            };
            q2.correctAnswer = new List <string> {
                "true"
            };

            SubjectiveCheckbox q3 = new SubjectiveCheckbox();

            q3.prompt  = "What desserts do you like?";
            q3.choices = new List <string> {
                "candy", "ice cream", "cake", "pie", "none of these :("
            };
            q3.correctAnswer = new List <string> {
                "candy", "ice cream", "cake", "pie", "none"
            };

            MiscellaniousQuestions q4 = new MiscellaniousQuestions();

            q4.prompt  = "Do you like pineapple on pizza?";
            q4.choices = new List <string> {
                "yes", "no"
            };
            q4.correctAnswer = new List <string> {
                "yes", "no"
            };

            Checkbox q5 = new Checkbox();

            q5.prompt  = "Which of these are polygons?";
            q5.choices = new List <string> {
                "circle", "square", "octagon", "line"
            };
            q5.correctAnswer = new List <string> {
                "square", "octagon"
            };

            Quiz.AddQuestion(q1);
            Quiz.AddQuestion(q2);
            Quiz.AddQuestion(q3);
            Quiz.AddQuestion(q4);
            Quiz.AddQuestion(q5);

            Quiz.Print();
        }
示例#2
0
        static void Main(string[] args)
        {
            Quiz          quiz1    = new Quiz("LC101");
            List <string> q2answer = new List <string> {
                "a", "b", "x"
            };
            MultiChoice q1 = new MultiChoice("For what could you use a for loop? \nA. Print to screen \nB. Assign a " +
                                             "variable \nC. Go through a series of list items.", "c");
            Checkbox q2 = new Checkbox("What languages have we worked with so far: \nA. Python \nB. HTML " +
                                       "\nC. C++", q2answer);
            TrueFalse q3 = new TrueFalse("Java is the same as JavaScript", "f");

            quiz1.AddQuestion(q1);
            quiz1.AddQuestion(q2);
            quiz1.AddQuestion(q3);
            quiz1.TakeQuiz();
            Console.ReadLine();
        }