这周主要去参观了许多企业,学到了很多在学校学不到的东西,另外还敲了一个简单的学生信息管理系统:
package 开学考试;
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(" 石家庄铁道大学软件工程系 "); System.out.println(" 学生学籍管理系统 2019 版 "); System.out.println("***********************************************************"); System.out.println(" 1、 学生考试成绩录入"); System.out.println(" 2、 学生考试成绩修改"); System.out.println(" 3、 计算学生成绩绩点"); System.out.println(" 4、退出学籍管理系统"); System.out.println("**********************************************************"); choose=sc.nextInt(); switch(choose)//功能选择 { case 1: read(); break; case 2: change(); break; case 3: count(); break; case 4: a=false;//退出 break; } }//退出页面打印 System.out.println("***********************************************************"); System.out.println(" 谢谢使用石家庄铁道大学软件工程系学生学籍管理系统 2019 版"); System.out.println(" 制作人:信1805-3 闫起材"); System.out.println("***********************************************************"); } static void read_print(){//录入打印 System.out.println("***********************************************************"); System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 "); System.out.println(" 学生考试成绩录入"); System.out.println("***********************************************************"); } static void read_print2(){//录入界面打印 System.out.println("***********************************************************"); System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 "); System.out.println(" 学生考试成绩录入界面 "); System.out.println("***********************************************************"); } static void change_print(){//修改界面打印 System.out.println("***********************************************************"); System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 "); System.out.println(" 学生考试成绩修改界面 "); System.out.println("***********************************************************"); } static void count_print(){//绩点计算界面打印 System.out.println("***********************************************************"); System.out.println(" 石家庄铁道大学软件工程系学生学籍管理系统 2019 版 "); System.out.println(" 学生考试成绩绩点计算界面"); 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("请输入学生学号:"); String first_stunum=sc.next(); for(;i<5;i++){ if(first_stunum.equals(stu[i].getstunumber())){ a1=false; break; } if(a1){ System.out.println("该学号不存在!请重新输入!"); } } } String jud=" "; for(int j=0;j<6;j++){ read_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); if(j==0){ System.out.println("请输入高等数学成绩:"); stu[i].set_mathematicsscore(sc.nextDouble()); } if(j>0){ System.out.print("高等数学成绩:"); System.out.println(stu[i].getmathematicsscore()); } if(j>1){ System.out.print("大学英语成绩:"); System.out.println(stu[i].getenglishiscore()); } if(j>2){ System.out.print("计算机网络成绩:"); System.out.println(stu[i].getnetworkscore()); } if(j>3){ System.out.print("数据库成绩:"); System.out.println(stu[i].getdatabasescore()); } if(j>4){ System.out.print("软件工程成绩:"); System.out.println(stu[i].getsoftwarescore()); } if(j==1){ System.out.println("请输入大学英语成绩:"); stu[i].set_englishiscoreint(sc.nextDouble()); } if(j==2){ System.out.println("请输入计算机网络成绩:"); stu[i].set_networkscore(sc.nextDouble()); } if(j==3){ System.out.println("请输入数据库成绩:"); stu[i].set_databasescore(sc.nextDouble()); } if(j==4){ System.out.println("请输入软件工程成绩:"); stu[i].set_softwarescoree(sc.nextDouble()); } if(j==5){ System.out.println("该学生成绩已录入完毕,是否提交(Y/N)"); jud=sc.next(); if(jud.equals("N")){ a1=true; } else{ a2=false; } } } //外层循环(while a2) } i=0; } static void change(){//更改成绩 boolean a1=true; boolean a2=true; while(a2){ while(a1){ change_print(); System.out.println("请输入学生学号:"); String first_stunum=sc.next(); for(;i<5;i++){ if(first_stunum.equals(stu[i].getstunumber())){ a1=false; break; } if(a1){ System.out.println("该学号不存在!请重新输入!"); } } } int jud=0; change_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.print("1、高等数学成绩:"); System.out.println(stu[i].getmathematicsscore()); System.out.print("2、大学英语成绩:"); System.out.println(stu[i].getenglishiscore()); System.out.print("3、计算机网络成绩:"); System.out.println(stu[i].getnetworkscore()); System.out.print("4、数据库成绩:"); System.out.println(stu[i].getdatabasescore()); System.out.print("5、软件工程成绩:"); System.out.println(stu[i].getsoftwarescore()); jud=sc.nextInt(); switch(jud){ case 1: change_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.println("请输入修改后的高等数学成绩:"); stu[i].set_mathematicsscore(sc.nextDouble()); break; case 2: change_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.println("请输入修改后的大学英语成绩:"); stu[i].set_englishiscoreint(sc.nextDouble()); break; case 3: change_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.println("请输入修改后的计算机网络成绩:"); stu[i].set_networkscore(sc.nextDouble()); break; case 4: change_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.println("请输入修改后的数据库成绩:"); stu[i].set_databasescore(sc.nextDouble()); break; case 5: change_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.println("请输入修改后的软件工程成绩:"); stu[i].set_softwarescoree(sc.nextDouble()); break; } System.out.println("是否返回系统主界面:(Y/N)"); String aa=sc.next(); if(aa.equals("N")){ a1=true; } else a2=false; } i=0; } static void count(){//计算绩点 boolean a1=true; boolean a2=true; while(a2){ while(a1){ count_print(); System.out.println("请输入学生学号:"); String first_stunum=sc.next(); for(;i<5;i++){ if(first_stunum.equals(stu[i].getstunumber())){ a1=false; break; } if(a1){ System.out.println("该学号不存在!请重新输入!"); } } } 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; }//软件工程 sum=(math*4+english*3+net*4+date*3+soft*2)/16; count_print(); System.out.print("学生学号:"); System.out.println(stu[i].getstunumber()); System.out.print("学生姓名:"); System.out.println(stu[i].getname()); System.out.print("高数成绩绩点:"); System.out.println(math); System.out.print("大学英语绩点:"); System.out.println(english); System.out.print("计算机网络绩点:"); System.out.println(net); System.out.print("数据库绩点:"); System.out.println(date); System.out.print("软件工程绩点:"); System.out.println(soft); System.out.print("平均绩点:"); System.out.println(sum); if(sum>2){ System.out.println("你的学分绩点已达到毕业要求!"); } else{ System.out.println("你的学分绩点不满足毕业要求!"); } System.out.println("是否返回系统主界面:(Y/N)"); String bb=sc.next(); if(bb.equals("N")){ a1=true; } else a2=false; } } }
下周还是以学业为重。