Code: Select all
import java.util.Scanner;
public class Checker {
public static class outputVal{
private String polarity, type;
public outputVal(String x, String y){
this.polarity = x;
this.type = y;
}
public String getPolarity() {
return polarity;
}
public String getType() {
return type;
}
}
public static int[] getInput(){
Scanner scanner = new Scanner(System.in);
try{
String input = scanner.nextLine();
String [] inputTokens = input.split("\\s+");
int [] intTokens = new int[5];
for(int i=0; i0 ? "Positive" : "Negative";
}
}
public static String evenOdd(int x){
return x%2 ==0 ? "Even" : "Odd";
}
public static String checkValue(int[] x){
if(x.length x[(x.length)-1] ? "Greater" : "Lesser";
}
}
public static void main(String[] args) {
int[] input = new int[5];
while(input.length == 0){
System.out.print("Enter five integers: ");
input = getInput();
if(input.length == 0 )System.out.println("[ERROR] Inappropriate Data. Please try again.");
}
if(input.length