7
A fun programming exercise is to write a program that quizzes the user from a set list of questions and answers. However, this task goes a level beyond that.
Your task
- Write a program/func/etc. that takes two lists: A list of questions and a list of answers.
- Output a program that quizzes the user.
- The output program should ask each question on a separate line, which each question with a colon and space at the end like,
What is 2+2:
. - After the user answers all the questions, output a newline, and then one on each line, questions correct, questions wrong, and percentage calculation (rounded to 2 decimal places) as such (the brackets are user input):
What is the meaning of life, the universe, and everything: <42>
Am I awesome(Yes/No): <No>
What is 2+2: <4>
Number Correct: 2
Number Wrong: 1
Score: 2 / 3 * 100 = 66.67%
Scoring
- You are scored on the size of your compiler program.
- This is code-golf so shortes code in bytes wins!
- Bonus: Score *.9 if you implement a flag in your compiler that makes the output program randomize question order.
If none are correct, or all are wrong, should that line be skipped? – Ypnypn – 2015-11-25T05:28:45.473
@Ypnypn no, they should always be there. – Maltysen – 2015-11-25T12:04:25.683