import java.util.Scanner;
public class App {
/**
* The start point of the program
*
* @param args
*/
public static void main(String[] args) {
Scanner keyBoard = new Scanner(System.in);
System.out.print("Enter height: ");
int height = keyBoard.nextInt();
System.out.print("Enter age: ");
int age = keyBoard.nextInt();
System.out.print("Enter citizenship code('C' for citizen of Endor, 'N' for non-citizen: ");
String citizen = keyBoard.next();
System.out.print("Enter recommendee code ('R' for recommendee, 'N' for non-recommendee): ");
String recommended = keyBoard.next();
if (recommended.equalsIgnoreCase("r")
|| (height >= 200 && age >= 21 && age <= 25 && citizen.equalsIgnoreCase("c"))) {
System.out.println("Accepted");
} else {
System.out.println("Rejected");
}
keyBoard.close();
}
}
Comments
Leave a comment