-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGL_NotGreater.java
More file actions
34 lines (28 loc) · 842 Bytes
/
GL_NotGreater.java
File metadata and controls
34 lines (28 loc) · 842 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
package Java_Courses;
public class NotGreater {
private static int notGraterValue = 1;
private static double[] inputArray = {3.9, 7.5, 2.1, 2.0, 9};
public static int getNotGreaterValue()
{
return notGraterValue;
}
public static double[] getInputArray() {
return inputArray;
}
public static void main(String[] args) {
double[] inputArray = getInputArray();
int notGraterValue = getNotGreaterValue();
String result = null;
for (int i = 0; i < inputArray.length; i++) {
if (inputArray[i] < notGraterValue){
result = i + " " + inputArray[i];
break;
}
}
if (result == null)
{
System.out.println("Not Found");
}
else System.out.println(result);
}
}