c12oop.simplequiz.lab
Class Simplequiz

java.lang.Object
  extended by c12oop.simplequiz.lab.Simplequiz

public class Simplequiz
extends java.lang.Object

Simplequiz implements a list of quiz questions (only short-answer questions in this version).

Version:
8dec2009
Author:
kvlinden

Constructor Summary
Simplequiz()
           
 
Method Summary
 boolean checkCurrentAnswer(java.lang.String answer)
          Returns true if the given answer is correct for the current question.
 java.lang.String getCurrentAnswer()
          Return the answer to the current question
 java.lang.String getCurrentQuestion()
          Return the full specification for the current question.
 boolean hasNext()
          Returns true if this quiz has another question.
 void next()
          Advance to the next question.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Simplequiz

public Simplequiz()
           throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getCurrentQuestion

public java.lang.String getCurrentQuestion()
Return the full specification for the current question.

Returns:
the full question

getCurrentAnswer

public java.lang.String getCurrentAnswer()
Return the answer to the current question

Returns:
the answer

checkCurrentAnswer

public boolean checkCurrentAnswer(java.lang.String answer)
Returns true if the given answer is correct for the current question.

Parameters:
answer - the user's answer
Returns:
true if and only if the given answer is correct

hasNext

public boolean hasNext()
Returns true if this quiz has another question.

Returns:
true if and only if this quiz has another question

next

public void next()
          throws java.lang.Exception
Advance to the next question.

Throws:
java.lang.Exception - if there are no more questions