Java Student Achievement Management System
/** @ ------ Create a mobile terminal homework ------ * @ copyright by lzy on 2016/4/12. * @ name: java student achievement management system. * @ function: Student-related information, input, query, statistics, and modification .... * @ PS: the student management system of the graphic interface is not required. */import java. util. imports; import java. lang. *; import java. io. *; class Student {private static Student [] s = new Student [100]; // maximum number of students allowed for entry int n = 0; private String name; private int num; private String classAge; private int chinese; private int math; private int english; // determines whether any input is required. Generate public void judge () throws IOException {int I; char ch; String str; expect In = new expect (System. in); if (n = 0) {System. out. println ("You have not entered any student information, whether to input (Y/N):"); str = In. next (); ch = str. charAt (0); while (ch! = 'Y' & ch! = 'Y' & ch! = 'N' & ch! = 'N') {System. out. println ("incorrect input. Please enter again:"); str = In. next (); ch = str. charAt (0);} if (ch = 'y' | ch = 'y') {this. add () ;}if (ch = 'n' | ch = 'n') {this. menu () ;}}// menu public void menu () throws IOException // throws an exception and calls this method to handle the exception. If the main method also throws an exception, it is handed over to the Java Virtual Machine for processing, the same below. {int a; vertex in = new partition (System. in); System. out. println ("*************** student information management System **************"); System. out. println ("***** 1. enter student information ****** "); System. out. println ("**** * 2. display student information ****** "); System. out. println ("***** 3. modify student information ****** "); System. out. println ("***** 4. delete student information ****** "); System. out. println ("***** 5. view student information ****** "); System. out. println ("***** 0. log out of the management System ****** "); System. out. println ("************************************* *****"); system. out. print ("select (0 ~ 5): "); a = in. nextInt (); while (a <0 | a> 5) {System. out. print ("the input is invalid. Please enter it again:"); a = in. nextInt ();} switch (a) {case 1: this. add (); break; case 2: this. show (); break; case 3: this. modif (); break; case 4: this. delete (); break; case 5: this. look (); break; case 0: System. out. println ("successfully exited the system !!! "); System. exit (0); break ;}// enter the student information public void add () throws IOException {String str, str1, str2; int I, num1, t = 1; char ch, delimiter; FileWriter fw = new FileWriter ("E: // student.txt", true); // enter the student information to the fw in the specified txt file. write ("input student information list \ r \ n student ID name class language score mathematical score English Score \ r \ n"); student In = new student (System. in); while (t = 1) {System. out. println ("Enter the student ID:"); num1 = In. nextInt (); // determines whether the student ID is repeated for (I = 0; I
Part: