-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion.java
More file actions
58 lines (46 loc) · 1.47 KB
/
Copy pathQuestion.java
File metadata and controls
58 lines (46 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class Question {
private String question;
private String possibleA;
private String possibleB;
private String possibleC;
private String answer;
private String wrong;
public Question(String question, String possibleA, String possibleB, String possibleC, String answer,String wrong){
setQuestion(question);
setPossibleA(possibleA);
setPossibleB(possibleB);
setPossibleC(possibleC);
setAnswer(answer);
setWrong(wrong);
}
public String getQuestion() {
return "Question:\n"+question+"\n"+
"A."+ possibleA+"\n"+
"B."+ possibleB+"\n"+
"C."+ possibleC+"\n";
}
public void setAnswer(String answer) {
this.answer = answer;
}
public void setWrong(String wrong) {
this.wrong = wrong;
}
public void setQuestion(String question) {
this.question = question;
}
public void setPossibleA(String possibleA) {
this.possibleA = possibleA;
}
public void setPossibleB(String possibleB) {
this.possibleB = possibleB;
}
public void setPossibleC(String possibleC) {
this.possibleC = possibleC;
}
public boolean isAnswer(String userAnswer) {
return (userAnswer.equalsIgnoreCase(answer));
}
public boolean isWrong(String userAnswer) {
return (userAnswer.equalsIgnoreCase(wrong));
}
}