A Simple Quiz Project using OOPs.





This blog presents the outline for a simple project implementing a quiz application. The application will consist of a series of multiple choice questions. The questions will be saved in a file using serialization. 

Three classes will be built having the following members

  • Class Question
    • Fields(All fields will be private with getters.).
      1. Qno int
      2. Question String
      3. Option A String
      4. Option B String 
      5. Option C String
      6. Option D String
      7. Correct Option int
      8. Explanation String. This will be shown while displaying the results in case of a wrong answer.
    • Functions
      • Constructor. Take all the inputs
      • Display. Display the question
  • Class QuestionsSupplier
    • Fields
      • questions. Array of Questions
      • total questions. int
      • current question no int
    • Functions
      • Constructor. Initialize questions array, set total questions and initialize current question no.
      • previous. Return the previous question if it exists otherwise throw exception
      • next. Get the next question if it exists otherwise exception.
      • getQuestionByQuestionNo. This will get question by question no.

We will extend this later on to database and a web interface. Watch this space.

Post a Comment

0 Comments