Write a program to read in various types of test questions

Assignment Help C/C++ Programming
Reference no: EM132109186

Programming language: C++

Write a C++ program to read in various types of test questions (multiple choice and True/False) from a test bank (text file), and load the questions into an array of questions. You will need to implement the following class hierarchy (given in UML):

Line 1 will be an integer value, indicating how many questions in the file

Each question will start with a line that starts with either "MC" or "TF" followed by a space and then the point value of the question.

The next line will be the actual question.

If the question was True/False, the following line will be the answer, either "True" or "False"

If the question was multiple choice, the following line will be an integer value indicating how many choices will be provided for that question. The following lines will be the choices.

There will never be more than 6 choices. The final line following the choices will be the answer: "A" or "B" or "C" or "D" or "E" or "F".

A sample test bank file is as follows:

3

TF 5

There exist birds that cannot fly?

true

MC 10

Who was the President of the USA in 1991?

6

Richard Nixon

Gerald Ford

Jimmy Carter

Ronald Reagan

George Bush Sr.

Bill Clinton

E

TF 10

The city of Boston hosted the 2004 Summer Olympics?

false

Reference no: EM132109186

Questions Cloud

Simulate the experience of a days business at a bank : At program launch, it will query the user for the number of tellers working that day. There must be at least four tellers, and no more than ten tellers.
Write a program for converting us measurement values : Write a program for converting US measurement values to their corresponding metric measurement.
Design a payroll class with a string containing the employee : Write another program that demonstrates the class by creating a Payroll object , then asking the user to enter the data for an employee.
Write a void method named that accepts an integer array : Write a void method named clear that accepts an integer array , and the number of elements in the array and sets the elements of the array to 0.
Write a program to read in various types of test questions : Write a C++ program to read in various types of test questions (multiple choice and True/False) from a test bank (text file), and load the questions.
Determine if the two dimensional array is a magic square : Determine if the two dimensional array is a magic square. The main method will read the size of the array outside of the while loop
Develop both an uml diagram and the corresponding java class : Develop both an uml diagram and the corresponding java class for a New York State Win 4 lottery ticket .
Prepapre a database of books that are stored using a vector : Create a database of books that are stored using a vector. Keep track of the author, title, and publication date of each book.
What is the big deal with this as far as complex projects : what is the big deal with this as far as complex projects are concerned? Surely it is a common characteristic of project management and those whom practice

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a c program to read from a file called input

Write a C program to read from a file called "input.txt" information about 5 workers. Each line of input would contain two values respectively, an employee ID and the employee's monthly salary.

  Label object displaying the saying

Under the Format selection, include options of Font and Color. Wire the Font and Color options to the Windows predefined Font and Color dialog boxes so that when their values are changed, the text in the Label object displaying the saying is chang..

  Calculate and prints the average of the ratings

Write a C program that accepts by keyboard input (8) user-ratings of the Galaxy S5. The ratings use a scale of 1 to 10, where 10 represents a high rating and 1 represent a low rating: Calculate and prints the average of the ratings

  Difference between a reference vs a static variable

What is the difference between a Reference vs a Static Variable? When would you use either and why?

  The difference between while loop and for loop in c language

Please explain the difference between while loop and for loop in C language with examples.

  Declare an array of integers

Declare an array of 10 integers and initialize its elements to the following values: -10; -8; -6; -4; -2; 0; 2; 4; 6;8;10

  Programmingto compute the volume of water in the cubic feet

Write down an algorithm (Programming in C) in order to compute the volume of water in the cubic feet, flowing through a pipe of diameter d in feet, having a velocity of v feet per second.

  Which is not a valid name for a method or function

Which is not a valid name for a method or function? Which of the following is a valid overloaded version of this method

  Function declare that it can throw an ioexception

Every C++ function that performs file I/O will thus need to either declare that it can throw an IOException, or contain a try-catch-finally block to deal with it. Response?

  Deal two cards at a time

Deal two cards at a time, print them out.- Check if they are identical, have just the same rank or just same suit or are completely.different. Print out a message indicating the result of your comparison.

  Advantages and disadvantages of using iso standards

Discussion Questions from the book "A Guide to Computer Forensics and Investigations" 3rd Edition

  What happens when c is a function of just one variable

What happens when C is a function of just one variable? Can you provide a geometric interpretation of what gradient descent is doing in the one-dimensional case?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd