-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQuestion.java
More file actions
114 lines (100 loc) · 2.68 KB
/
Question.java
File metadata and controls
114 lines (100 loc) · 2.68 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/**
* The Question class allows us to create questions
*
* @author Naman/Jack/Evan
* @version December 11 2016
*/
public class Question
{
// instance variables
private String question, answer, displayValue;
private String[] choices = new String[4];
private int dollarAmount;
private boolean pickedYet;
/**
* Constructor for objects of class Question
*/
public Question(String question, String choice1, String choice2, String choice3, String choice4, String answer, int dollarAmount)
{
this.question = question;
this.answer = answer;
choices[0] = choice1;
choices[1] = choice2;
choices[2] = choice3;
choices[3] = choice4;
this.dollarAmount = dollarAmount;
displayValue = Integer.toString(dollarAmount);
pickedYet = false;
}
/**
* Gets stored value of question for object
*
* @param none
* @return question
*/
public String getQuestion()
{
return question;
}
/**
* Gets stored value of answer for object
*
* @param none
* @return answer
*/
public String getAnswer()
{
return answer;
}
/**
* Gets stored value of answer choices for object in position (i) of the array
*
* @param i = position within array
* @return choices[i] = value of choice stored within that index of the array
*/
public String getChoices(int i)
{
return choices[i];
}
/**
* Gets stored value of dollar amount for object
*
* @param none
* @return dollarAmount = value of question
*/
public int getDollarAmount()
{
return dollarAmount;
}
/**
* Gets stored display value for object
*
* @param none
* @return displayValue = returns value that is displayed within the UI
*/
public String getDisplayValue()
{
return displayValue;
}
/**
* Returns if question has been selected or not
*
* @param none
* @return pickedYet = boolean true or false
*/
public Boolean getPickedYet()
{
return pickedYet;
}
/**
* Sets stored value of pickedYet for object to true, along with updating displayValue
*
* @param none
* @return none
*/
public void setPickedYet()
{
pickedYet = true;
displayValue = "---";
}
}