Quiz_Assignment

Objective:

Create an interactive quiz game in Ruby that allows users to play quizzes on various topics. The game should provide multiple-choice questions, keep score, and display results at the end of each quiz.

Requirements:

  • Quiz Data: Prepare a set of quiz questions on different topics. You can use Ruby data structures like arrays or hashes to store quiz questions and their multiple-choice options, along with the correct answers.
  • User Interface: Create an interactive command-line interface (CLI) that welcomes users and presents them with a list of available quiz topics to choose from.
  • Quiz Logic: Implement the core logic of the quiz game. The program should randomly select questions from the chosen topic, present them one by one with multiple-choice options, and prompt the user to select an answer.
  • Scoring: Keep track of the user's score throughout the quiz. Award points for correct answers and display the final score at the end of the quiz.
  • Quiz Completion: Allow users to play multiple quizzes if they wish. After each quiz, display their score and ask if they want to play another quiz or exit the game.
  • Error Handling: Implement error handling to ensure that user input is valid and within the expected range.
  • Documentation: Provide clear instructions on how to navigate and play the game. Include examples of quiz data formats and how to add new quizzes.

Optional Enhancements:

  • Include a timer for each question to add an element of time pressure.
  • Create a leaderboard to track high scores.
  • Add a feature to let users create their own custom quizzes.
  • Use external data sources (e.g., CSV files) to load quiz questions dynamically.