import java.util.Scanner ;public class Problem1{ public static void main(String args){ Scanner input = new Scanner(System.in) ; String id = ” “, dept = ” ” , gender = ” ” , term = ” ” ; while ( id.
charAt(0) != ‘0’) { System.out.println(“Please enter a student ID. “); id = input.nextLine() ; char ary = new charid.length() ; for ( int i = 0 ; i length() ; i++ ) { aryi = id.charAt(i) ; } if (id.length() == 8 ) { if ( ary2 == ‘1’ ) { gender = “He” ; } if ( ary2 == ‘2’ ) { gender = “she” ; } if ( ary3 == ‘1’ ) { term = “fall” ; } if ( ary3 == ‘2’ ) { term = “winter” ; } if ( ary0 == ‘1’ && ary1 == ‘0’ ) { dept = “Science” ; } if ( ary0 == ‘1’ && ary1 == ‘1’ ) { dept = “Engineering” ; } if ( ary0 == ‘1’ && ary1 == ‘2’ ) { dept = “Nursing” ; } String year = id.substring(4,8) ; int yearnum = Integer. parseInt(year) ; boolean a = ( ary0 == ‘1’ && ary1 == ‘0’ ) ; boolean b = ( ary0 == ‘1’ && ary1 ==’1′ ) ; boolean c = ( ary0 == ‘1’ && ary1 == ‘2’ ) ; boolean d = ( ary2 == ‘1’ ) ; boolean e = ( ary2 == ‘2’ ) ; boolean f = ( ary3 == ‘1’ ) ; boolean g = ( ary3 == ‘2’ ) ; boolean h = ( yearnum <= 2017 && yearnum >= 2010 ) ; if( (a == true || b == true || c == true) && (d == true || e == true ) && (f == true || g == true ) && h == true ) System.out.println(“The student is in the department of ” + dept + “. ” + gender + ” entered the school in ” + term + ” ” + yearnum ) ; else System.out.println(“The student ID is incorrect.”) ; } else if(ary0 == ‘0’ ) break ; else System.out.println(“The student ID is incorrect.”) ; } System.out.println(“Good Bye!”) ; }}