Question: Code in C++ Create a Visual Studio C++ project. Multiple-choice question class Create a class for a multiple-choice question. Use the following diagram to identify
Code in C++

Create a Visual Studio C++ project. Multiple-choice question class Create a class for a multiple-choice question. Use the following diagram to identify the requirements. You can find a description of the format of this diagram in the section Unified Modeling Language Class Diagrams in chapter 10 from your textbook. Class files The class must be separated in a .h file (header, or definition of variables and function prototypes), and a.cor (source code). The main program Use that class in a main program that creates the following question. In Pirates of the Caribbean, what was Captain Jack Sparrow's ship's name? MCquestion -text: string +choices: striog[4] correctAnswer: int +setText(string): void +getText() const: string +setCorrectAnswer(int): void +getCorrectAnswer() const: int +is Correct(int) const: bool +display() const: void +MCquestion) +MCquestion(string) 1. The Marauder 2. The Black Pearl 3. The Black Python 4. The Slytherin Define the correct answer as The Black Pearl. Then, As seen in the diagram, MC question has 2 private member variables: text, and correctAnswer; and a public member array, choices. Choices is an array that stores the possible answer for a question's answer. This array contains 4 strings. correctAnswer stores the position in the array which contains the correct answer. display the question to the user, ask user what is the correct choice (integer value), display whether the user choice was correct or not (to determine whether the user choice is correct, use the isCorrect function). Also, it has two mutators: setText, and set CorrectAnswer; and two accessors: getText, and getCorrect Answer. In set CorrectAnswer function, do a validation. If the argument's value is not between 0-3 (inclusive), do not change the correct answer value. In addition, this class has a function called is correct, which given an integer argument, it will compare it with the correctAnswer, and returns whether the values are the same (true or false). Before doing the comparison, decrease the integer argument by one (-1). This is because the choices are stored in a 0- based index array, and the choices will be displayed in a 1-based index list. What files will be included in the VS project? A.sln file, a .vcxrroj file, a .vcxproi.filters file, a .vcxproi.user file, a main program (pr). The name of these files is based on the name of your project. Also, the class files: MCquestion and MCquestion.cpp. A Debug folder may also be included in your project folder. Also, the class has a display function which shows the question and the choices (with an index, 1-4). Finally, it has 2 constructors: a no-argument constructor, and a one-argument constructor whose argument is the question's text. The one argument construction will only initialize the text of the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
