davitacols / CS1102-PROGRAMMING-ASSIGNMENT-UNIT-2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CS1102-PROGRAMMING-ASSIGNMENT-UNIT-2

MultipleChoiceQuestion class is created with class variables nQuestions and nCorrect, instance variables question and correctAnswer, and a constructor to initialize the instance variables with passed parameters. The check method is modified to not take any parameters and use the question and correctAnswer instance variables of the object. The main method in Quiz class now creates three objects of MultipleChoiceQuestion class with the question, answer options, and correct answer passed as parameters. The check method is called on each object to display the question and check the user's answer. Finally, showResults method is called to display the number of correct and total questions answered.

About


Languages

Language:Java 100.0%