-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProblem.java
185 lines (159 loc) · 3.58 KB
/
Problem.java
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/**
*
* A representation of a problem, containing the pathnames to a problem and
* solution image, the name of the problem, the problem category (with 0 being
* kinematics, 1, newton's laws, 2, energy, 3, rotation, 4, gravitation, and 5,
* fluids), and the char answer, a through e.
*
* @author Krishnakumar Bhattaram
* @version May 23, 2018
* @author Period: 2
* @author Assignment: QuickQuiz
*
* @author Sources: none
*/
public class Problem
{
/**
* The pathname of the problem image
*/
private String problemImage;
/**
* The pathname of the solution image
*/
private String solutionImage;
/**
* The name of the problem
*/
private String name;
/**
* The type of the problem
*/
private int type;
/**
* The problem's answer
*/
private char answer;
/**
* Constructs the Problem class, and sets the fields to the corresponding
* parameters
*
* @param probim
* Pathname of the problem image
* @param solim
* Pathname of the solution image
* @param nam
* Name of the problem
* @param category
* Problem category
* @param ans
* Problem's answer
*/
public Problem( String probim, String solim, String nam, int category, char ans )
{
problemImage = probim;
solutionImage = solim;
name = nam;
type = category;
answer = ans;
}
/**
*
* Accessor for the problem pathname
*
* @return problem image pathname
*/
public String getProblemImage()
{
return problemImage;
}
/**
*
* Accessor for the solution pathname
*
* @return solution image pathname
*/
public String getSolutionImage()
{
return solutionImage;
}
/**
* Accessor for the name of the problem
*
* @return problem's name
*/
public String getName()
{
return name;
}
/**
* Accessor for the type of the problem
*
* @return problem's type, with with 0 being kinematics, 1, newton's laws,
* 2, energy, 3, rotation, 4, gravitation, and 5, fluids
*/
public int getType()
{
return type;
}
/**
* Accessor for the answer of the problem
*
* @return problem's answer (a through e)
*/
public char getAnswer()
{
return answer;
}
/**
* Mutator for the problem image pathname
*
* @param probim
* Problem image pathname
*/
public void setProblemImage( String probim )
{
problemImage = probim;
}
/**
* Mutator for the solution image pathname
*
* @param solim
* Solution image pathname
*/
public void setSolutionImage( String solim )
{
solutionImage = solim;
}
/**
* Mutator for the problem name
*
* @param nam
* Problem name
*/
public void setName( String nam )
{
name = nam;
}
/**
* Mutator for the problem category
*
* @param category
* Problem category, with with 0 being kinematics, 1, newton's
* laws, 2, energy, 3, rotation, 4, gravitation, and 5, fluids
*/
public void setType( int category )
{
type = category;
}
/**
* Mutator for the problem answer
*
* @param ans
* Problem answer (a through e)
*/
public void setAnswer( char ans )
{
answer = ans;
}
}