-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuestion.java
More file actions
70 lines (50 loc) · 2.1 KB
/
Question.java
File metadata and controls
70 lines (50 loc) · 2.1 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
59
60
61
62
63
64
65
66
67
68
69
70
import java.util.ArrayList;
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
/**
*
* @author padilla
*/
public class Question {
String question;
String[] choices;
String correctAnswer;
public Question setQuestion(String question) {
this.question = question;
return this;
}
public Question setChoices(String...choices) {
this.choices = choices;
return this;
}
public Question setCorrectAnswer(String correctAnswer) {
this.correctAnswer = correctAnswer;
return this;
}
public static ArrayList<Question> setQuestion() {
ArrayList<Question> questions = new ArrayList<>();
questions.add(new Question()
.setQuestion("What is the capital of the Philippines?")
.setChoices("Manila", "Quezon City", "Makati", "Cavite")
.setCorrectAnswer("Manila"));
questions.add(new Question()
.setQuestion("Who is the National Hero of the Philipines?")
.setChoices("Andres Bonifacio", "Apolinario Mabini", "Juan Luna", "Jose Rizal")
.setCorrectAnswer("Jose Rizal"));
questions.add(new Question()
.setQuestion("Who named the Philippines?")
.setChoices("Magellan", "Ruy Lopez de Villlalobos", "King Philip ll", "Antonio Banderas")
.setCorrectAnswer("Magellan"));
questions.add(new Question()
.setQuestion("Who killed Magellan?")
.setChoices("Raja Solayman", "Lapu-lapu", "Meliodas", "Son Goku")
.setCorrectAnswer("Lapu-lapu"));
questions.add(new Question()
.setQuestion("Who is the founder of KKK?")
.setChoices("Emilio Aguinaldo", "Andres Bonifacio", "Antonio Luna", "Jose Rizl;")
.setCorrectAnswer("Andres Bonifacio"));
return questions;
}
}