-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathjavaCodingBatJEYII.java
More file actions
61 lines (55 loc) · 1.07 KB
/
Copy pathjavaCodingBatJEYII.java
File metadata and controls
61 lines (55 loc) · 1.07 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
public class javaCodingBatJEYII
{
public boolean sleepIn(boolean weekday, boolean vacation)
{
if (!weekday || vacation)
{
return true;
}
return false;
}
public int sumDouble(int a, int b)
{
if (a == b)
{
return (a+b)*2;
}
return a+b;
}
public int diff21(int n)
{
if(n>21)
{
return (n-21)*2;
}
else if(n <= 21)
{
return 21-n;
}
return -1;
}
public boolean makes10(int a, int b)
{
if(a == 10 || b == 10 || a+b ==10)
{
return true;
}
return false;
}
public boolean in1020(int a, int b)
{
if((a >= 10 && a <= 20)||(b >= 10 && b <= 20))
{
return true;
}
return false;
}
public boolean hasTeen(int a, int b, int c)
{
if ((a <= 19 && a >= 13)||(b <= 19 && b >= 13)||(c <= 19 && c >= 13))
{
return true;
}
return false;
}
}