logo Use SA10RAM to get 10%* Discount.
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Shalu KashyapComputer science
(5/5)

585 Answers

Hire Me
expert
Bernard BeckmannData mining
(5/5)

954 Answers

Hire Me
expert
Santosh NayarLaw
(5/5)

947 Answers

Hire Me
expert
Barry CresswellStatistics
(5/5)

545 Answers

Hire Me
C++ Programming

examination question class hierarchy was fully implemented in a menu-driven program an exam class was developed to load the exam from a file and display each question to the screen.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Part 1: Begin with the running program from your Phase 4 Individual Project where the examination question class hierarchy was fully implemented in a menu-driven program. An exam class was developed to load the exam from a file and display each question to the screen.

 Part 2: Modify the program from part 1 to change the menu to the following: Load an exam Take an exam Show exam results Quit Choice 1: No functionality change. Load the exam based upon the user's prompt for an exam file.

Choice 2: The program should display a single question at a time and prompt the user for an answer. Based upon the answer, it should track the score based upon a successful answer. Once a user answers the question, it should also display the correct answer with an appropriate message (e.g., "Good job" or "Better luck next time") Upon completion of the exam, the program should return the user to the menu.

Choice 3: The program should display the total points available and the total points scored during that exam. A percentage score should also be displayed. (Optional: if you choose to track which problems were missed, you could display that information for the user.) Choice 4: No change to this functionality from the Phase 4 IP. You should consider creating an additional class Student that will track student's score through methods such as addPointsPossible, addPointsScored, getPointsPossible, and getPointsScored. You should also enhance your Exam class to include methods getPointValue and getAnswer. You may also want to add a method to only display one question at a time, such as displayQuestion.

This is what i have from my last assignment: #include #include #include #include using namespace std; class exam { private: string examfile; public: exam(string examFileName) { examfile = examFileName; } bool loadExam() { ifstream file(examfile.c_str()); if (!file) { cout << "\nFile not found."; return false; } file.close(); return true; } void displayFile() { ifstream file(examfile.c_str()); string line; while (!file.eof()) { getline(file, line); cout << endl << line; } file.close(); } }; int main() { string examFileName; bool correctFileCheck; char ch = 'y'; while (ch == 'y' || ch == 'y') { int choice = 0; cout << "EXAM MENU\n\n"; cout << "1. Load an exam." << endl; cout << "2. Display the exam." << endl; cout << "3. Quit." << endl; cout << "\nEnter your choice : "; cin >> choice; if (choice == 1) { cout << "Enter the file name: : "; cin >> examFileName; exam t(examFileName); correctFileCheck = t.loadExam(); if (correctFileCheck) { cout << "\nLoaded successfully"; } } else if (choice == 2) { cout << "Enter the file name : "; cin >> examFileName; exam t(examFileName); correctFileCheck = t.loadExam(); if (correctFileCheck) { cout << "\nThe content of the file is" << " as follows:" << endl; t.displayFile(); } } cout << "\nEnter your choice : "; cin >> choice; if (choice == 1) { cout << "Enter the file name: : "; cin >> examFileName; exam t(examFileName); correctFileCheck = t.loadExam(); if (correctFileCheck) { cout << "\nLoaded successfully."; } } else if (choice == 3) { break; } else { cout << "\nWrong input: please enter" << " the correct input."; } cout << "\nDo you want to enter the choice " << "again? (y/n) : "; cin >> ch; } cout << "\nIts done! Thank you! Have a nice day!" << endl << endl; system("pause"); return 0; }

 

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme

Get Free Quote!

299 Experts Online