Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Write a C++ program to allow the user to create a test bank of questions. The program should first ask the user how many questions he or she wishes to create. This quantity will be the first line in...

1 answer below »
Write a C++ program to allow the user to create a test bank of questions. The program should first ask the user how many questions he or she wishes to create. This quantity will be the first line in the test bank. The user should now be prompted for all information for each question, and then that question is written out to the test bank in the exact format specified in the Phase 2 Individual Project.

For each question, the following information should be gathered:

Question type: Multiple choice (MC) or True/False (TF)
Question value
Actual question
If the question is TF, then get answer
If the question is MC, then get the number of options followed by each option and finally the answer
This program should be robust and allow users who make mistakes the ability to correct them (exception handling).

--------------------------------------------------------------

The questions and answers that need to be in place of the sample output are:

Enter the Question type and value
T/F

Enter the Question: Superman is from the planet, Krypton?
Enter answer true/false
True
Superman is from the planet, Krypton?
True

---------------------------------------------------------------
Enter the Question type and value
MC

Enter the Question: Which is not a Kellogg's cereal?
Enter the number of choices: 6

Enter next option: Rice Krispies

Enter next option: Fruit Loops

Enter next option: Cheerios

Enter next option: Raisin Bran

Enter next option: Corn Flakes

Enter next option: Apple Jacks

Enter Answer: Cheerios
Which is not a Kellogg's cereal?
A. Rice Krispies
B. Fruit Loops
C. Cheerios
D. Raisin Bran
E. Corn Flakes
F. Apple Jacks

---------------------------------------------------------------
Enter the Question type and value
T/F

Enter the Question: The New Orleans Saints have won four Super Bowls?
Enter answer true/false
False
The New Orleans Saints have won four Super Bowls?
False

----------------------------------------------------------------------

I will need the full code provided with results.
Answered Same Day Nov 30, 2021

Solution

Sudipta answered on Dec 03 2021
152 Votes
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;
int main()
{
ofstream outFile;
outFile.open ("output.txt");
A text file 'output.txt' will be created or opened in the same directory of the .cpp file
string option, type, question, answer;
int totalOptions;
try{
cout...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here