-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
34 lines (28 loc) · 1.05 KB
/
App.java
File metadata and controls
34 lines (28 loc) · 1.05 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
import java.util.ArrayList;
import java.util.List;
public class App {
public static void main(String[] args){
1
Quiz quiz1 = new Quiz("General Knowledge Test");
String text1 = "What was the original name of the Java language?";
List<String> choices1 = new ArrayList<>();
choices1.add("*7");
choices1.add("Duke");
choices1.add("Oak");
choices1.add("Gosling");
Question first = new Question(text1, choices1, "Oak");
quiz1.addQuestion(first);
String text2 = "In which country was the Java language born?";
List<String> choices2 = new ArrayList<>();
choices2.add("Australia");
choices2.add("Canada");
choices2.add("Denmark");
choices2.add("USA");
Question second = new Question(text2, choices2, "Canada");
quiz1.addQuestion(second);
quiz1.attemptQuiz();
System.out.println("Your final score: " + quiz1.getFinalScore());
System.out.println("List of all the answers: ");
quiz1.revealAnswerKey();
}
}