The second portion (instruction shown below) which is the actual C++ program is needed by this Saturday.Write a C++ program that is menu-driven that allows for the following menu choices:Load an exam: Loading an exam should prompt the user for an exam file. If no file exists, it should allow the user to specify a different file. Upon a successful load of an exam, the user should be presented with the menu again. Display exam: The program should simply display each question, its point value, and the answer to the screen. (The functionality of actually taking the exam will be created in Week 5). Upon displaying the exam to the screen, the user should be presented with the menu again. Quit: Quit the program gracefully by displaying a “thank you” message to the user, and ensure that all files have been closed along with any other housekeeping that should be done as your program shuts down. Consider creating a class exam that will hold the actual exam and provide behavior such as loadExam and also displayExam. This class will be enhanced in Week 5

The task at hand is to write a menu-driven C++ program that allows the user to perform various actions related to exams. The program should provide the following menu choices: Load an exam, Display exam, and Quit.

The first menu choice, Load an exam, prompts the user to enter the name of an exam file. If the specified file does not exist, it should provide an option for the user to specify a different file. Once an exam file is successfully loaded, the user should be presented with the menu again.

The second menu choice, Display exam, simply displays each question, its point value, and the answer to the screen. It does not involve taking the actual exam at this point. After displaying the exam on the screen, the user should be presented with the menu again.

The final menu choice, Quit, allows the user to gracefully exit the program. It should display a “thank you” message to the user and perform any necessary cleanup tasks, such as closing files and other housekeeping activities.

To achieve this functionality, it is recommended to create a class called “exam” that will hold the actual exam information and provide behavior such as loadExam and displayExam. This class can be further enhanced in Week 5, as specified in the task.

In terms of implementation, you can start by defining the class “exam” with appropriate member variables and member functions. The loadExam function can use file handling techniques to read the exam file, validate its existence, and load its contents into the class. The displayExam function can simply output the exam information stored in the class to the screen.

Next, you can create a main function that acts as a driver for the menu-driven program. It should present the main menu options to the user, accept their choice, and execute the corresponding functionality based on the chosen option. This can be done using conditional statements or a switch statement.

Overall, the program organization should include a class “exam” to handle the loading and displaying of exam information, and a main function to drive the menu-driven program. It is important to ensure that the program gracefully handles any errors, such as invalid file names or incorrect user input.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer