-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethods.java
More file actions
45 lines (39 loc) · 916 Bytes
/
Methods.java
File metadata and controls
45 lines (39 loc) · 916 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package mathPractice;
import java.util.Random;
public class Methods {
int scores = 0;
public String incorrectResponse() {
Random number = new Random();
switch(number.nextInt(4)) {
case 1:
return ("Try Again");
case 2:
return ("Nope! you'll get it next time.");
case 3:
return ("Wrong! Don't give up, you can do it.");
case 4:
return ("Wrong! you gotta try a little harder.");
}
return ("Wrong! you gotta try a little harder.");
}
public String correctResponse() {
Random number = new Random();
switch(number.nextInt(4)) {
case 1:
return ("Awesome Job!");
case 2:
return ("100% Correct!");
case 3:
return ("Correct answer!!");
case 4:
return ("Great Work! ");
}
return ("Awesome Job!");
}
public int highestScore(int score) {
if (score > scores){
scores = score;
}
return scores;
}
}