-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQuestion.java
More file actions
32 lines (25 loc) · 766 Bytes
/
Copy pathQuestion.java
File metadata and controls
32 lines (25 loc) · 766 Bytes
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
import java.util.Scanner;
import java.io.IOException;
import java.io.File;
import java.util.Arrays;
import java.io.*;
//Class for Questions
public class Question {
private String question;
private int posRightAnswer;
private String[] choices;
public Question(String question, int posRightAnswer, String[] choices) { //constructor
this.question = question;
this.posRightAnswer = posRightAnswer;
this.choices = choices;
}
public String getQuestion() { //gets the Question
return question;
}
public String[] getChoices() { //gets the array of choices
return choices;
}
public int getAnswer() { //return true of the pos of right answer is correct
return posRightAnswer;
}
} //end of class