Quiz with sample questions about C++.
Simple structure base for an object oriented project.
You can find the main program in main.cpp
.
The main function read all questions from the quiz.txt
text file.
I used the fstream
library from C++ to read the questions from this file.
The function reading the file runs only through needed lines.
So if you want to change the structure of questions and answers you need to rewrite void Question::read() and update it. Changing the structure of the text file without changing the reading function will lead to errors.
The question class will create an array. Every question, get 3 methods read();ask();checkAnswer(). Just use them to set the quiz together -> see more in main.cpp
C++