This is a console-based quiz application developed in C++. It allows users to answer multiple-choice questions loaded from a text file, provides immediate feedback on each response, calculates the final score, and saves the results to a file for progress tracking. This project was originally developed during my first semester of the Computer Science program as part of my introductory C++ coursework.
- Loads multiple-choice questions from an external text file
- Provides immediate feedback for each answer
- Calculates the user's final score
- Saves user scores for progress tracking
- Allows questions to be added, removed, or customized
-
Ensure
questions.txtis in the same directory asmain.cpp. -
Compile the program:
Windows:
g++ main.cpp -o quizMac/Linux:
g++ main.cpp -o quiz -
Run the application:
Windows:
quiz.exeMac/Linux:
./quiz -
Follow the prompts to enter your name and complete the quiz.
-
The program creates a
user_results.txtfile containing user scores.
Questions can be added, removed, or modified by editing questions.txt.
Use the following format:
Question|Choice1|Choice2|Choice3|Choice4|CorrectAnswer
- Each question must be on a new line.
- The correct answer must be
A,B,C, orD. - Do not add extra spaces around the
|separators.
- C++
- File I/O
- Standard C++ Library
Mahsa Fazli