micher43

E9.4 AnyCorrectChoiceQuestion

Dec 2nd, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public class AnyCorrectChoiceQuestion {
  2.    
  3.     public String question;
  4.     public String wrongChoice;
  5.     public String wrongChoice2;
  6.     public String correctChoice1;
  7.     public String correctChoice2;
  8.     public String allAnswers = correctChoice1 + " , " + correctChoice2;
  9.    
  10.     public boolean checkAnswer(String response){
  11.         if(response.equals(correctChoice1) || response.equals(correctChoice2)){
  12.             return true;
  13.         }
  14.         else{
  15.             return false;
  16.         }
  17.        
  18.            
  19.     }
  20.    
  21.     public String answer(){
  22.         return allAnswers;
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment