im doing a school project and i choosed a quizz... I decided to do it with random order so my Idea is to make every question as object which has property of correct answer, question content itself etc... and i did it. But i wanna to seperate this class, constuructor and objects into different files to have cleaner code and have the ability to rewrite questions and answers anytime i want... but i really dont know how to do it...
Im thankful for every answer :)
class QuestionsLayout
{
public:
string questionName;
char corans;
string ans1;
string ans2;
string ans3;
string ans4;
QuestionsLayout(string questionname, char corAns, string Ans1, string Ans2, string Ans3, string Ans4)
{
questionName = questionname;
corans = corAns;
ans1 = Ans1;
ans2 = Ans2;
ans3 = Ans3;
ans4 = Ans4;
}
};
int main()
{
//Questions and Answers (rewritable)
QuestionsLayout q1("What is largest in Solar System?", 'A', "A - Sun", "B - Jupiter", "C - Mercury", "D - Pluto");
QuestionsLayout q2("What symbol has Helium?", 'C', "A - Hc", "B - Ha", "C - He", "D - H");
QuestionsLayout q3("How many Mammal Species we know?", 'D', "A - 5256", "B - 3586", "C - 8235", "D - 5416");
}