Skip to content

Latest commit

ย 

History

History
50 lines (48 loc) ยท 1.87 KB

File metadata and controls

50 lines (48 loc) ยท 1.87 KB

Math-Quiz-Game

A console-based Math Quiz game written in C++. Supports multiple difficulty levels, operation types, score tracking, colored feedback, and a final pass/fail result.

โž•โž–โœ–๏ธโž— Math Quiz Game (C++)

This is an interactive console-based Math Quiz game written in C++. The player answers a set of randomly generated math questions based on selected difficulty level and operation type, with instant feedback and a final result summary.

๐ŸŽฎ How It Works

The player chooses: Number of questions (1โ€“10) Question difficulty: Easy Medium Hard Mixed Operation type: Addition Subtraction Multiplication Division Mixed For each question: Two random numbers are generated based on the difficulty level. A math operation is applied. The player enters their answer. The program checks the answer and gives instant feedback: ๐ŸŸข Green โ†’ Correct answer ๐Ÿ”ด Red โ†’ Wrong answer (with correct result shown) After all questions, the final results are displayed.

๐Ÿ”ง Features

Customizable number of questions (1โ€“10). Multiple difficulty levels (Easy, Medium, Hard, Mixed). Multiple operation types (Add, Sub, Mul, Div, Mixed). Random question generation. Tracks correct and wrong answers. Final PASS / FAIL result. Color-based feedback for each answer. Replay option after finishing the quiz.

๐Ÿง  Technical Concepts Used

Enumerations (enum): For question levels and operation types. Structures (struct): To organize questions and quiz data. Random number generation: For questions and mixed operations. Functions: For modular design (generate questions, validate answers, show results). Arrays: To store multiple questions. Console color formatting: Using system("color") for visual feedback. Input validation: Ensures correct user inputs.

๐Ÿ–ฅ๏ธ How to Compile and Run

Make sure you have a C++ compiler installed (e.g. g++). Save the file as Math-Quiz-Game.cpp. Compile and run: