Question: In C + + , improve the code by creating a separate program, but using the same Questions class to load a text file with
In C improve the code by creating a separate program, but using the same Questions class to load a text file with the questions if it exists allow to edit the list of questions and save them. Then make the first program to load the questions from the file.
#ifndef QUESTIONH
#define QUESTIONH
#include
class Question
private:
std::string question;
std::string ans;
std::string ans;
std::string ans;
std::string ans;
int correct;
public:
Question std::string q std::string a std::string a std::string a std::string a int c constructor
question q; ans a; ans a; ans a; ans a; correct c;
void data const
std::cout question ans ans ans correct std::endl;
std::string, std::cin, std::cout
;
#endif CLASSNAMEH
#include
#include
#include "Question.h
using namespace std;
prototypes USE ONLY IF YOU WILL USE FUNCTIONS
int main
ifstream ifile;
Question quest Question
QuestionFastest land animal", "Cheetah", "Mouse", "Turtle", "Snail",
QuestionLargest State in US "Texas", "California", "Florida", "Alaska",
QuestionStinkiest flower", "Rose", "Titanarum", "Tulip", "Hydrangea",
QuestionBiggest dog breed", "ShiTzu", "Pitbull", "Bulldog", "EnglishMastiff",
QuestionColor of the sun", "Green", "Pink", "Yellow", "Red",
QuestionLongestrunning soap opera", "Daysofourlives", "GuidingLight", "Baywatch", "GeneralHospital",
QuestionHighest grossing Disney movie", "Frozen "LittleMermaid","TheLionKing", "BeautyandtheBeast",
QuestionColor of the sky "Blue", "White", "Grey", "Brown",
QuestionCapitol of Peru", "Caracas", "Lima", "Quito", "Monaco", ;
for int i ; i ; i
questidata;
return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
