-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMunchies.java
More file actions
48 lines (32 loc) · 776 Bytes
/
Copy pathMunchies.java
File metadata and controls
48 lines (32 loc) · 776 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
46
47
48
public class Munchies {
public static int FindMultiple(int num) {
int multiple = num * 5;
return multiple;
}
public static boolean isLeapYear(int num) {
if (num % 4 == 0) {
return true;
} else{
return false;
}
}
public static int ComputerSumOfNumber(int num) {
int number1 = (num / 1000) % 10;
int number2 = (num / 100) % 10;
int number3 = (num / 10) % 10;
int number4 = (num / 1) % 10;
int total = number1 + number2 + number3 + number4;
return total;
}
public static String FindMultiplesOf7Not5(int num) {
if (num < 2000 || num > 3200) {
return "Wrong number";
} else if (num % 7 == 0) {
if (num % 5 == 0) {
return "number is divisible by 7";
}
return "number is not a multiple of 5";
}
return " ";
}
}