This week to visit a lot of major companies, learned a lot of things not learn in school, and also knocked a simple student information management system:
package of school examinations;
public class ScoreInformation { private String stunumber =" "; private String name =" "; private double mathematicsscore =0; private double englishiscore=0; private double networkscore=0; private double databasescore=0; private double softwarescore=0; public String getstunumber() { return stunumber; } public void set_stunumber(String num) { this.stunumber = num; } public String getname() { return name; } public void set_name(String name) { this.name = name; } public double getmathematicsscore() { return mathematicsscore; } public void set_mathematicsscore(double math) { this.mathematicsscore = math; } public double getenglishiscore() { return englishiscore; } public void set_englishiscoreint(double english) { this.englishiscore = english; } public double getnetworkscore() { return networkscore; } public void set_networkscore(double networkscore) { this.networkscore = networkscore; } public double getdatabasescore() { return databasescore; } public void set_databasescore(double databasescore) { this.databasescore = databasescore; } public double getsoftwarescore() { return softwarescore; } public void set_softwarescoree(double softwarescore) { this.softwarescore = softwarescore; } }
package 开学考试; import java.util.Scanner; public class first { static boolean a=true; static ScoreInformation[] stu =new ScoreInformation[100]; static Scanner sc = new Scanner(System.in); public static void main(String[] args) {//主函数 for(int i=0;i<5;i++){ stu[i]=new ScoreInformation(); } stu[0].set_stunumber("20183734"); stu[0].set_name("闫起材"); stu[1].set_stunumber("20183735"); stu[1].set_name("小明"); stu[2].set_stunumber("20183736"); stu[2].set_name("小红"); stu[3].set_stunumber("20183737"); stu[3].set_name("小亮"); stu[4].set_stunumber("20183738"); stu[4].set_name("小芳"); while (a){ int choose=0;//主页面打印 System.out.println("***********************************************************"); System.out.println("Software Engineering, University of Shijiazhuang Railway "); System.out.println (" Student Management System version 2019 "); System.out.println (" ****************** ***************************************** "); System.out.println ( "1 student test scores entry"); System.out.println ( "2, student test scores modification"); System.out.println ( "3, calculate student achievement Grade point"); System.out.println ( " 4, quit school management system "); System.out.println (" ********************************** ************************ "); choose = sc.nextInt (); switch (choose) // function selection {case 1: read () ; break; case 2: change (); break; case 3: count (); break; case 4: a = false; // exit break;}} // exit pages printed System.out.println ( "*** ************************************************** ****** "); System.out.println (" Thank you for the use of Shijiazhuang Railway Institute of software Engineering student management system version 2019 "); System.out.println ("Producer: 1805-3 Yan channel from material "); System.out.println (" ******************************** *************************** ");} static void read_print () {// entry print System.out.println (" ** ************************************************** ******* "); System.out.println (" Shijiazhuang Railway Institute of software Engineering student management system version 2019 "); System.out.println (" student test scores entry "); System.out. println ( "*********************************************** ************ ");} static void read_print2 () {// entry screen printing System.out.println (" **************** ******************************************* "); System.out. println ( "Shijiazhuang Railway Institute of software Engineering student management system version 2019"); System.out.println ( "student test scores input interface"); System.out.println ( "********** ************************************************* " );} static void change_print () {// print modification interface System.out.println ( "*********************************************** ************ "); System.out.println (" Shijiazhuang Railway Institute of software Engineering student management system version 2019 "); System.out.println (" student test scores modification interface " ); System.out.println ( "***************************************** ****************** ");} static void count_print () {// Print Grade point Computation System.out.println (" ******** ************************************************** * "); System.out.println (" Shijiazhuang Railway Institute of software Engineering student management system version 2019 "); System.out.println (" student test scores to calculate grade point interface "); System.out.println (" ************************************************** ********* ");} static int i = 0; static void read () {boolean a1 = true; boolean a2 = true; while (a2) {while (a1) {read_print (); System .out.println ( "Please enter the student number:"); String first_stunum = sc.next (); for (; i <5;i ++) {if (first_stunum.equals (stu [i] .getstunumber ())) {a1 = false; break; "!! learn the number does not exist please re-enter"} if (a1) {System.out.println ( );}}} String jud = ""; for (int j = 0; j <6; j ++) {read_print (); System.out.print ( "student number:"); System.out.println (stu [i] .getstunumber ()); System.out.print ( "student name:"); System.out.println (stu [i] .getname ()); if (j == 0) {System.out. println ( "Please enter the higher math:"); stu [i] .set_mathematicsscore (sc.nextDouble ());} if (j> 0) {System.out.print ( "Advanced math:"); System. out.println (stu [i] .getmathematicsscore ());} if (j> 1) {System.out.print ( "in achievement:"); System.out.println (stu [i] .getenglishiscore () );} if (j> 2) {System.out.print ( "computer network results:"); System.out.println (stu [i] .getnetworkscore ());} if (j>3) {System.out.print ( "Database Results:"); System.out.println (stu [i] .getdatabasescore ());} if (j> 4) {System.out.print ( "Software engineering achievement : "); System.out.println (stu [i] .getsoftwarescore ());} if (j == 1) {System.out.println (" Please enter in achievement: "); stu [i]. set_englishiscoreint (sc.nextDouble ());} if (j == 2) {System.out.println ( "Please enter the computer network results:"); stu [i] .set_networkscore (sc.nextDouble ());} if (j == 3) {System.out.println ( "Please enter the database results:"); stu [i] .set_databasescore (sc.nextDouble ());} if (j == 4) {System.out.println ( "Please enter the software Engineering results:"); stu [i] .set_softwarescoree (sc.nextDouble ());} if (j == 5) {System.out.println ( "the entry has been completed student achievement, whether submitted (Y / N) "); jud = sc.next (); if (jud.equals (" N ")) {a1 = true;} else {a2 = false;}}} // outer loop (while a2 )} i = 0;} Static void change () {// Change the achievement boolean a1 = true; boolean a2 = true; while (a2) {while (a1) {change_print (); System.out.println ( "Enter the student number:") ; String first_stunum = sc.next (); for (; i <5; i ++) {if (first_stunum.equals (stu [i] .getstunumber ())) {a1 = false; break;} if (a1) {System .out.println ( "!! the student number does not exist, please re-enter");}}} int jud = 0; change_print (); System.out.print ( "student number:"); System.out.println (stu [i] .getstunumber ()); System.out.print ( "student name:"); System.out.println (stu [i] .getname ()); System.out.print ( "1, HIGHER math: "); System.out.println (stu [i] .getmathematicsscore ()); System.out.print (" 2, university English scores: "); System.out.println (stu [i] .getenglishiscore ()); System.out.print ( "3, a computer network performance:"); System.out.println (stu [i].getnetworkscore ()); System.out.print ( "4, database performance:"); System.out.println (stu [i] .getdatabasescore ()); System.out.print ( "5, software engineering achievement:" ); System.out.println (stu [i] .getsoftwarescore ()); jud = sc.nextInt (); switch (jud) {case 1: change_print (); System.out.print ( "student number:" ); System.out.println (stu [i] .getstunumber ()); System.out.print ( "student name:"); System.out.println (stu [i] .getname ()); System.out .println ( "Please enter the higher mathematics achievement revised:"); stu [i] .set_mathematicsscore (sc.nextDouble ()); break; case 2: change_print (); System.out.print ( "student number: "); System.out.println (stu [i] .getstunumber ()); System.out.print (" student name: "); System.out.println (stu [i] .getname ()); System. out.println ( "Please enter university English scores revised:"); stu [i].set_englishiscoreint (sc.nextDouble ()); break; case 3: change_print (); System.out.print ( "student number:"); System.out.println (stu [i] .getstunumber ()); System. out.print ( "student name:"); System.out.println (stu [i] .getname ()); System.out.println ( "Please enter the computer network performance amended:"); stu [i] .set_networkscore (sc.nextDouble ()); break; case 4: change_print (); System.out.print ( "student number:"); System.out.println (stu [i] .getstunumber ()); System .out.print ( "student name:"); System.out.println (stu [i] .getname ()); System.out.println ( "Please enter the database performance amended:"); stu [i] .set_databasescore (sc.nextDouble ()); break; case 5: change_print (); System.out.print ( "student number:"); System.out.println (stu [i] .getstunumber ()); System .out.print ( "student name:");System.out.println (stu [i] .getname ()); System.out.println ( "Please enter the modified software engineering achievement:"); stu [i] .set_softwarescoree (sc.nextDouble ()); break ;} System.out.println ( "return to the main interface if: (Y / N)"); String aa = sc.next (); if (aa.equals) ( "N") {a1 = true;} else a2 = false;} i = 0;} static void count () {// calculation Result points boolean a1 = true; boolean a2 = true; while (a2) {while (a1) {count_print (); System.out.println ( "Please enter student number:"); String first_stunum = sc.next (); for (; i <5; i ++) {if (first_stunum.equals (stu [i] .getstunumber ())) {a1 = false ; break;} if (a1) {System.out.println ( "Science the number does not exist Please reenter!!");}}} double math = 0, english = 0, net = 0, date = 0, soft = 0, sum = 0; if (stu [i] .getmathematicsscore () <60) {math = 0;} if (stu [i].getmathematicsscore()>=60&&stu[i].getmathematicsscore()<=63.9){ math=1.0; } if(stu[i].getmathematicsscore()>63.9&&stu[i].getmathematicsscore()<=65.9){ math=1.5; } if(stu[i].getmathematicsscore()>=66&&stu[i].getmathematicsscore()<=67.9){ math=1.7; } if(stu[i].getmathematicsscore()>=68&&stu[i].getmathematicsscore()<=71.9){ math=2.0; } if(stu[i].getmathematicsscore()>=72&&stu[i].getmathematicsscore()<=74.9){ math=2.3; } if(stu[i].getmathematicsscore()>=75&&stu[i].getmathematicsscore()<=77.9){ math=2.7; } if(stu[i].getmathematicsscore()>=78&&stu[i].getmathematicsscore()<=81.9){ math=3.0; } if(stu[i].getmathematicsscore()>=82&&stu[i].getmathematicsscore()<=84.9){ math=3.3; } if(stu[i].getmathematicsscore()>=85&&stu[i].getmathematicsscore()<=89.9){ math=3.7; } if(stu[i].getmathematicsscore()>=90){ math=4.0; } if(stu[i].getmathematicsscore()<60){ math=0; }//数学 if(stu[i].getenglishiscore()>=60&&stu[i].getenglishiscore()<=63.9){ english=1.0; } if(stu[i].getenglishiscore()>63.9&&stu[i].getenglishiscore()<=65.9){ english=1.5; } if(stu[i].getenglishiscore()>=66&&stu[i].getenglishiscore()<=67.9){ english=1.7; } if(stu[i].getenglishiscore()>=68&&stu[i].getenglishiscore()<=71.9){ english=2.0; } if(stu[i].getenglishiscore()>=72&&stu[i].getenglishiscore()<=74.9){ english=2.3; } if(stu[i].getenglishiscore()>=75&&stu[i].getenglishiscore()<=77.9){ english=2.7; } if(stu[i].getenglishiscore()>=78&&stu[i].getenglishiscore()<=81.9){ english=3.0; } if(stu[i].getenglishiscore()>=82&&stu[i].getenglishiscore()<=84.9){ english=3.3; } if(stu[i].getenglishiscore()>=85&&stu[i].getenglishiscore()<=89.9){ english=3.7; } if(stu[i].getenglishiscore()>=90){ english=4.0; }//英语 if(stu[i].getnetworkscore()<60){ net=0; } if(stu[i].getnetworkscore()>=60&&stu[i].getnetworkscore()<=63.9){ net=1.0; } if(stu[i].getnetworkscore()>63.9&&stu[i].getnetworkscore()<=65.9){ net=1.5; } if(stu[i].getnetworkscore()>=66&&stu[i].getnetworkscore()<=67.9){ net=1.7; } if(stu[i].getnetworkscore()>=68&&stu[i].getnetworkscore()<=71.9){ net=2.0; } if(stu[i].getnetworkscore()>=72&&stu[i].getnetworkscore()<=74.9){ net=2.3; } if(stu[i].getnetworkscore()>=75&&stu[i].getnetworkscore()<=77.9){ net=2.7; } if(stu[i].getnetworkscore()>=78&&stu[i].getnetworkscore()<=81.9){ net=3.0; } if(stu[i].getnetworkscore()>=82&&stu[i].getnetworkscore()<=84.9){ net=3.3; } if(stu[i].getnetworkscore()>=85&&stu[i].getnetworkscore()<=89.9){ net=3.7; } if(stu[i].getnetworkscore()>=90){ net=4.0; }//计算机 if(stu[i].getdatabasescore()<60){ date=0; } if(stu[i].getdatabasescore()>=60&&stu[i].getdatabasescore()<=63.9){ date=1.0; } if(stu[i].getdatabasescore()>63.9&&stu[i].getdatabasescore()<=65.9){ date=1.5; } if(stu[i].getdatabasescore()>=66&&stu[i].getdatabasescore()<=67.9){ date=1.7; } if(stu[i].getdatabasescore()>=68&&stu[i].getdatabasescore()<=71.9){ date=2.0; } if(stu[i].getdatabasescore()>=72&&stu[i].getdatabasescore()<=74.9){ date=2.3; } if(stu[i].getdatabasescore()>=75&&stu[i].getdatabasescore()<=77.9){ date=2.7; } if(stu[i].getdatabasescore()>=78&&stu[i].getdatabasescore()<=81.9){ date=3.0; } if(stu[i].getdatabasescore()>=82&&stu[i].getdatabasescore()<=84.9){ date=3.3; } if(stu[i].getdatabasescore()>=85&&stu[i].getdatabasescore()<=89.9){ date=3.7; } if(stu[i].getdatabasescore()>=90){ date=4.0; }//数据库 if(stu[i].getsoftwarescore()<60){ soft=0; } if(stu[i].getsoftwarescore()>=60&&stu[i].getsoftwarescore()<=63.9){ soft=1.0; } if(stu[i].getsoftwarescore()>63.9&&stu[i].getsoftwarescore()<=65.9){ soft=1.5; } if(stu[i].getsoftwarescore()>=66&&stu[i].getsoftwarescore()<=67.9){ soft=1.7; } if(stu[i].getsoftwarescore()>=68&&stu[i].getsoftwarescore()<=71.9){ soft=2.0; } if(stu[i].getsoftwarescore()>=72&&stu[i].getsoftwarescore()<=74.9){ soft=2.3; } if(stu[i].getsoftwarescore()>=75&&stu[i].getsoftwarescore()<=77.9){ soft=2.7; } if(stu[i].getsoftwarescore()>=78&&stu[i].getsoftwarescore()<=81.9){ soft=3.0; } if(stu[i].getsoftwarescore()>=82&&stu[i].getsoftwarescore()<=84.9){ soft=3.3; } if(stu[i].getsoftwarescore ()> = 85 && stu [i] .getsoftwarescore () <= 89.9) {soft = 3.7;} if (stu [i] .getsoftwarescore ()> = 90) {soft = 4.0;} // Software Engineering sum = ( math * 4 + english * 3 + net * 4 + date * 3 + soft * 2) / 16; count_print (); System.out.print ( "student number:"); System.out.println (stu [i ] .getstunumber ()); System.out.print ( "student name:"); System.out.println (stu [i] .getname ()); System.out.print ( "the high number of grades Grade point Average:" ); System.out.println (math); System.out.print ( "university English grade point:"); System.out.println (english); System.out.print ( "computer network grade point:"); System.out.println (net); System.out.print ( "database grade point:"); System.out.println (date); System.out.print ( "software Engineering GPA:"); System.out .println (soft); System.out.print ( "GPA:"); System.out.println (sum); if (sum> 2) {System.out.println ( "Your Grade Point has reached the requirements for graduation!");} else {System.out.println ( "Your Grade Point does not meet the requirements for graduation!");} System.out.println ( "whether to return the system The main interface: (Y / N) "); String bb = sc.next (); if (bb.equals (" N ")) {a1 = true;} else a2 = false;}}}
Next week, or in their studies as the most important.