Multiple Choice Quiz Program

 

Overview:  In this program, you will create a ten-question multiple choice quiz on a topic of your choice.  The questions, possible answers, and correct answer will all be stored as DATA that will be read by the program.  After each data set is read, the question and possible answers will be displayed on the screen.  The user will pick an answer and the computer will declare them correct or incorrect before moving to the next question.

 

Specifics:

 

Start by entering your 10 questions as DATA sets.  Each DATA set should contain the following information in this order:

 

DATA question, answerA, answerB, answerC, answerD, correct.letter

 

For example, the following data set could exist:

 

DATA Who is the best stooge?, Larry, Curly, Moe, Shep, B

 

Each data set should be displayed as a multiple choice question with A, B, C, D choices.  The data above would be shown as the following question:

 

Who is the best stooge?

A. Larry

B. Curly

C. Moe

D. Shep

 

The “correct” answer would be B, or Curly, but this fact would be hidden from the user. 

 

At this point, the user would be given the opportunity to answer the question using an INPUT statement.  If the user answers B, then the computer says “CORRECT”.  Anything else and the computer says, “INCORRECT – The correct answer was B”. 

 

After the first question has been asked, answered, and corrected, the program loops to the second question.

 

 

 

Extension #1:  Add a counter that counts only when the user answers a question correctly.  After all ten questions have been answered, the program should report the users score.

 

Extension #2:  Adjust your program so that the user’s score is expressed as a percentage and a grade.  For example 6 out of 10 would be 60%, which is a D-.

 

Extension #3:  Adjust your program so that the programmer can easily add more questions.  This should be done with a sentinel record.