You are on page 1of 3

3.

WRITTEN RESPONSES

3 a.
3.a.i.
The purpose of the quiz program is to give multiple different quizzes that the user can choose from and take. The program
is meant for the user to be able to take a few quick quizzes to test their knowledge on a few different topics.

3.a.ii.
The video demonstrates the ability to choose different quizzes and to move through each question giving your answers
and receiving a score at the end of the quiz, as well as showing the option to continue to take new quizzes or to end the
program.

3.a.iii.
The video shows the user inputting an answer to whatever question is being displayed and outputting whether the users
answer was correct or incorrect. It also shows input and output when the user is choosing what quiz they would like to
take, their input being the quiz that they choose and the output being the program displaying the questions for that quiz.

3 b.
3.b.i.

3.b.ii.

3.b.iii.
The list being used in this response is called math_quiz.

3.b.iv.
The math_quiz list contains the questions and the answers for the math quiz in my program. The list is representing the
questions asked if the user chooses to take the math quiz and the answers to the questions that are asked.

3.b.v.
This list is managing complexity in my program storing all of the questions and answers in one place and accessing
them through an iterative function instead of printing them all one by one. This is also making it easier to group the
questions with the answers, as I can use the index numbers to find whether it is the question or the answer to the
question and to iterate through each question and answer. Without this list I would have had to find a much different way
to group and check for the correct answers, meaning assigning a variable to almost every question and answer and
checking each answer from the user separately based on the question asked and it would lead to a lot more code
whereas the list groups it together already, making it easy to access and to sort the questions and answers.
3 c.
3.c.i.

3.c.ii.

3.c.iii.
The open_quiz procedure takes the users input of which quiz to take and uses that choice as the parameter for the
procedure, starting the chosen quiz for them, iterating through the questions and returning their score after they have
answered all of the questions on the test. This procedure helps to run all of the quiz options in the program as well as to
return the users score on the quizzes
3.c.iv.
My algorithm in the open_quiz procedure first tests what quiz that the user chose. The chosen quiz is then iterated
through using a for loop, asking the questions and testing if the users answers are correct, informing the user after. At the
end of the quiz the program will return a percentage score to the user for the quiz. After the score is returned to the user,
the procedure will then ask the user if they would like to take another quiz. Calling on another procedure, the program will
take the user response and either end the program or allow the user to take a new quiz. If a word that does not match
any of the quizzes is given to the procedure, the procedure will ask the user to choose again.

3 d.
3.d.i.
First call:
If the user chooses to take a math quiz then the math quiz questions will be iterated through one by one, taking the
users answers and telling them whether they were right or wrong. At the end of the quiz a score will be given to the user.

Second call:
If the user enters a word that does not match any of the quiz names they will be told that their response is invalid and
they will be given another chance to choose a quiz to take.

3 d.ii.
Condition(s) tested by first call:
The first call is testing for which quiz the user chose by checking if the users input matches any of the quiz options. The
options for the quizzes are math, capitals, word scramble, and Spanish.

Condition(s) tested by second call:


The second call is testing for an invalid response. It tests if the user inputs something that was not one of the quiz
options.

3.d.iii.
Results of the first call:
The quiz that the user chose is iterated through, asking the questions to the user and taking their answers, giving them a
score at the end of the test.

Results of the second call:


The program will tell the user that they gave an invalid response then give the user another chance to choose a quiz to
take.

You might also like