Question: Write a program to generate a multiple choice test. The file multiplechoice.txt contains the set of multiple choice questions. Each question has exactly four choices.
Write a program to generate a multiple choice test. The file multiplechoice.txt contains the set of multiple choice questions. Each question has exactly four choices.
The layout of each item of data stored in the question is as follows:
question ID (string without spaces on a line by itself)
Text (question on line by itself, string that can contain spaces)
Choices (4 choices, each on individual line, followed by correct response on line by itself, followed by 0 or 1 where 1 indicates that the responses should be shuffled and 0 indicates otherwise.
Points (the amount of points gained if each question is correctly answered)
The program must:
- Read all of the questions from multiplechoice.txt and store them into an array referred to as Bank. The file contains at most 100 questions.
- Create an array of test questions by randomly selecting M questions (specified by the user) from the Bank. The array of test questions is referred to as the QPaper. When a question is selected from the Bank, the four choices must be shuffled, if necessary
- Allow a user to take the multiple choice by presenting the questions from the QPaper, one by one. Three actions are possible when a question is displayed to the user: (i) the user answers the question correctly (ii) the user answers the question incorrectly (iii) the user skips the question. A record must be kept of the users performance on each question
- At the end of the multiple choice, a summary of the users performance is given. The summary displays how many responses were correct or incorrect and how many questions were skipped. The total marks obtained by the user is also displayed.
MUST BE DONE IN C++ AND INCLUDE THE FOLLOWING LIBARARIES:
#include
#include
#include
#include
#include
#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
