java计算并显示学生的成绩_Java开学测试-学生成绩管理系统
題目:
1、定義 ScoreInformation 類,其中包括七個私有變量(stunumber, name, mathematicsscore, englishiscore,networkscore, databasescore,softwarescore)。各成員的含義如下:
變量 stunumber 為字符串類型 String,用于存儲學生的學號(有 8 位數字組成)。變量 name 為字符串類型 String,用于存儲學生的姓名。變量 mathematicsscore 為 double 類型,用于存儲學生的高等數學成績,高等數學的學分為 4 分。變量 englishiscore 為 double 類型,用于存儲學生的大學英語成績,大學英語的學分為 3 分。變量 networkscore 為 double 類型,用于存儲學生的計算機網絡成績,計算機網絡的學分為 4 分。變量 databasescore 為 double 類型,用于存儲學生的數據庫成績,數據庫的學分為 3 分變量 softwarescore 為 double 類型,用于存儲學生的軟件工程成績,軟件工程的學分為 2 分。對每個變量定義 get()(讀取變量信息)和 set()(設置變量信息)的方法。
2 、 賦 初 值 方 法 包 括 七 個 參 數 , 用 于 為 變 量 (stunumber ,name, mathematicsscore, englishiscore,networkscore, databasescore,softwarescore)賦值。
三、功能要求:(10 分)
該系統完成學生成績錄入,修改,計算學分積點和查詢學生成績的簡單功能,定義 ScoreManagement 類完成下列功能。
1、利用數組實現至少存儲五個學生的信息; (將考生信息作為第一條記錄)。(1 分)
2、學生成績管理系統的主界面如下圖所示:(1 分)
①界面要求;(0.5 分)
***********************************************************
石家莊鐵道大學軟件工程系
學生學籍管理系統 2019 版
***********************************************************
1、 學生考試成績錄入
2、 學生考試成績修改
3、 計算學生成績績點
4、退出學籍管理系統
**********************************************************
第 2 頁 共 8 頁②功能說明
輸入數字 1-4 執行相應的功能,輸入其他數字提示錯誤信息(該選項
不存在),并返回主界面。(0.5 分)
2、成績錄入功能操作流程:(3 分)
①在主界面選擇成績錄入功能后,進入成績錄入界面,如下圖所示:(0.5
分)
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績錄入
***********************************************************
請輸入學生學號:XXXXXXXX
**********************************************************
提示用戶輸入八位的學號。
②用戶輸入學號后,顯示用戶學號和姓名,如果用戶學號不存在或信息錯
誤提示錯誤信息(該學號不存在),并返回成績錄入界面。(0.5 分)
③用戶輸入學號正確如下圖所示:
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績錄入界面
***********************************************************
學生學號:20183557
學生姓名:楊雄豪
請輸入高等數學成績:XXX
**********************************************************
提示用戶輸入高等數學成績,用戶輸入正確的數字;則提示用戶輸入大學
英語成績,依次類推,提示用戶錄入計算機網絡、數據庫、軟件工程成績,當
第 3 頁 共 8 頁用戶錄完所有成績后,顯示如下界面。(1.5 分)
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績錄入
***********************************************************
學生學號:20183557
學生姓名:楊雄豪
高等數學成績:XXX
大學英語成績:XXX
計算機網絡成績:XXX
數據庫成績:XXX
軟件工程成績:XXX
該學生成績已錄入完畢,是否提交(Y/N)
**********************************************************
選擇“Y”將錄入成績保存到相應的數組中,并返回主界面。選擇“N”,
則忽略上述成績錄入,并返回成績錄入界面。(0.5 分)
3、成績修改功能操作流程:(2 分)
①在主界面選擇成績修改功能后,進入考試成績修改界面,如下圖所示:
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績修改界面
***********************************************************
請輸入學生學號:XXXXXXXX
**********************************************************
提示用戶輸入八位的學號。(0.5 分)
第 4 頁 共 8 頁②用戶輸入學號后,顯示用戶學號、姓名和全部成績信息,如下圖所示。
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績錄入
***********************************************************
學生學號:20183557
學生姓名:楊雄豪
1、高等數學成績:XXX
2、大學英語成績:XXX
3、計算機網絡成績:XXX
4、數據庫成績:XXX
5、軟件工程成績:XXX
**********************************************************
如果用戶學號不存在或信息錯誤提示錯誤信息(該學號不存在),并返回成績修改界面。(0.5 分)
③用戶選擇相應的數字鍵,切換到如下界面(假如選擇數字“5”)。(0.5分)
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績錄入界面
***********************************************************
學生學號:20183557
學生姓名:楊雄豪
請輸入修改后軟件工程成績:XXX
**********************************************************
錄入修改后的成績,則進入下一步。
第 5 頁 共 8 頁***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績錄入
***********************************************************
學生學號:20183557
學生姓名:楊雄豪
1、高等數學成績:XXX
2、大學英語成績:XXX
3、計算機網絡成績:XXX
4、數據庫成績:XXX
5、軟件工程成績:XXX
該學生成績已修改完畢,是否提交(Y/N)
**********************************************************
選擇“Y”將修改后成績保存到相應的數組中,并返回主界面。選擇“N”,則忽略上述成績錄入,并返回成績修改界面。(0.5 分)
3、計算學生成績績點功能操作流程:(2 分)
①在主界面選擇計算學生成績績點功能后,進入計算學生成績績點界面,
如下圖所示:
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績績點計算界面
***********************************************************
請輸入學生學號:XXXXXXXX
**********************************************************
第 6 頁 共 8 頁提示用戶輸入八位的學號。
②用戶輸入學號后,顯示用戶學號、姓名、學分績點、提示信息。如下圖
所示。(1.5 分)
***********************************************************
石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
學生考試成績績點計算界面
***********************************************************
學生學號:20183557
學生姓名:楊雄豪
1、高等數學成績績點:XXX
2、大學英語成績績點:XXX
3、計算機網絡成績績點:XXX
4、數據庫成績績點:XXX
5、軟件工程成績績點:XXX
你的平均學分績點為:XXX
提示信息:XXX XXX XXX XXX XXX XXX XXX
是否返回系統主界面:(Y/N)
**********************************************************
如果學分績點大于等于 2,提示信息顯示“你的學分績點已達到畢業要求!”;
如果學分績點小于 2,提示信息顯示“你的學分績點不滿足畢業要求!”
學分績點計算方法:
(1) 百分制對應績點
(2)平均學分計算方法
平均學分績點=∑ ( 課程績點× 該課程學分) /∑ 課程學分
計算平均學分績點按四舍五入原則, 小數點后保留兩位有效數字。
③選擇“Y”返回系統主界面。選擇“N”,無操作。(0.5 分)
4、用戶選擇數字“4”,顯示如下界面,退出當前程序。(1 分)
***********************************************************
謝謝使用石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版
制作人:考生姓名
***********************************************************
Java編程思路:
先私有定義各個對象 ,然后對每個變量定義 get()(讀取變量信息)和 set()(設置變量信息),方便在ScoreManagement 類中調用給對象賦值和讀取該對象的值;然后按要求編寫主界面函數和退出函數,先簡后難;編寫主界面是運用switch、case選擇;退出函數運用system.exit(-1)強制退出。然后依次編寫錄入成績函數、修改成績函數、和計算績點的函數,注意題目要求,用for循環找的對應的學號和姓名以及其各科成績。然后實現Y和N的判斷,是Y退出循環,回到主界面,是N回到錄入(修改)界面。
packagexiaoceshi;public classScoreInformation {privateString stunumber;privateString name;private doublemathematicsscore;private doubleenglishiscore;private doublenetworkscore;private doubledatabasescore;private doublesoftwarescore;publicString getStunumber() {returnstunumber;
}public voidsetStunumber(String stunumber) {this.stunumber =stunumber;
}publicString getName() {returnname;
}public voidsetName(String name) {this.name =name;
}public doublegetMathematicsscore() {returnmathematicsscore;
}public void setMathematicsscore(doublemathematicsscore) {this.mathematicsscore =mathematicsscore;
}public doublegetEnglishiscore() {returnenglishiscore;
}public void setEnglishiscore(doubleenglishiscore) {this.englishiscore =englishiscore;
}public doublegetNetworkscore() {returnnetworkscore;
}public void setNetworkscore(doublenetworkscore) {this.networkscore =networkscore;
}public doublegetDatabasescore() {returndatabasescore;
}public void setDatabasescore(doubledatabasescore) {this.databasescore =databasescore;
}public doublegetSoftwarescore() {returnsoftwarescore;
}public void setSoftwarescore(doublesoftwarescore) {this.softwarescore =softwarescore;
}public ScoreInformation(String stunumber,String name,double mathematicsscore,double englishiscore,double networkscore,double databasescore,doublesoftwarescore)
{
}publicScoreInformation() {
}
}
packagexiaoceshi;importjava.util.Scanner;public classScoreManagement {static ScoreInformation s[]=new ScoreInformation[100];static int N=0;static Scanner scanner=newScanner(System.in);public static voidchushizhi(){
s[0]=newScoreInformation();
s[0].setStunumber("20183704");
s[0].setName("趙文軒");
s[0].setMathematicsscore(0);
s[0].setEnglishiscore(0);
s[0].setNetworkscore(0);
s[0].setDatabasescore(0);
s[0].setSoftwarescore(0);
s[1]=newScoreInformation();
s[1].setStunumber("20183705");
s[1].setName("aaa");
s[1].setMathematicsscore(0);
s[1].setEnglishiscore(0);
s[1].setNetworkscore(0);
s[1].setDatabasescore(0);
s[1].setSoftwarescore(0);
s[2]=newScoreInformation();
s[2].setStunumber("20183706");
s[2].setName("bbb");
s[2].setMathematicsscore(0);
s[2].setEnglishiscore(0);
s[2].setNetworkscore(0);
s[2].setDatabasescore(0);
s[2].setSoftwarescore(0);
s[3]=newScoreInformation();
s[3].setStunumber("20183707");
s[3].setName("ccc");
s[3].setMathematicsscore(0);
s[3].setEnglishiscore(0);
s[3].setNetworkscore(0);
s[3].setDatabasescore(0);
s[3].setSoftwarescore(0);
s[4]=newScoreInformation();
s[4].setStunumber("20183708");
s[4].setName("ddd");
s[4].setMathematicsscore(0);
s[4].setEnglishiscore(0);
s[4].setNetworkscore(0);
s[4].setDatabasescore(0);
s[4].setSoftwarescore(0);
N=5;
}public static voidshow()
{
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("請輸入要執行的操作:");int t=scanner.nextInt();if(t<1&&t>4)System.out.println("輸入的錯誤信息");switch(t)
{case 1:input();break;case 2:change();break;case 3:jidain();break;case 4:EXIT();break;
}
}public static voidEXIT()
{
System.out.println("****************************************************");
System.out.println(" 謝謝使用石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 制作人:趙文軒");
System.out.println("****************************************************");
System.exit(-1);
}public static voidinput()
{while (true)
{int t=0;
System.out.println("*****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 請輸入學生學號:********");
System.out.println("****************************************************");
System.out.println("請輸入八位的學號:");
String a=scanner.next();for(int i=0;i
{if(a.equals(s[i].getStunumber()))
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入高等數學成績:");
System.out.println("****************************************************");
s[i].setMathematicsscore(scanner.nextDouble());if(s[i].getMathematicsscore()>0&&s[i].getMathematicsscore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 請輸入大學英語成績:");
System.out.println("****************************************************");
s[i].setEnglishiscore(scanner.nextDouble());if(s[i].getEnglishiscore()>0&&s[i].getEnglishiscore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 請輸入計算機網絡成績:");
System.out.println("****************************************************");
s[i].setNetworkscore(scanner.nextDouble());if(s[i].getNetworkscore()>0&&s[i].getNetworkscore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 請輸入數據庫成績:");
System.out.println("****************************************************");
s[i].setDatabasescore(scanner.nextDouble());if(s[i].getDatabasescore()>0&&s[i].getDatabasescore()<100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 輸入數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 請輸入軟件工程成績:");
System.out.println("****************************************************");
s[i].setSoftwarescore(scanner.nextDouble());if(s[i].getSoftwarescore()>0&&s[i].getSoftwarescore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 軟件工程成績:"+s[i].getSoftwarescore());
System.out.println("****************************************************");
System.out.println(" 該學生成績已錄入完畢,是否提交(Y/N)");
String c=scanner.next();if(c.equals("Y"))
{
t=1;break;
}else{
s[i].setMathematicsscore(0);
s[i].setEnglishiscore(0);
s[i].setNetworkscore(0);
s[i].setDatabasescore(0);
s[i].setSoftwarescore(0);break;
}
}else {t=0;break;}
}else {t=0;break;}
}else {t=0;break;}
}else {t=0;break;}
}
}else if(i==N-1)System.out.println("該學號不存在");
}if(t==1)break;
}
}public static voidchange()
{while(true)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 請輸入學生學號:********");
System.out.println("****************************************************");
String a=scanner.next();inti;int m=0;for(i=0;i
{if(a.equals(s[i].getStunumber()))
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 1.高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 2.大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 3.計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 4.數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 5.軟件工程成績:"+s[i].getSoftwarescore());
System.out.println("****************************************************");doublex1,x2,x3,x4,x5;
x1=s[i].getMathematicsscore();
x2=s[i].getEnglishiscore();
x3=s[i].getNetworkscore();
x4=s[i].getDatabasescore();
x5=s[i].getSoftwarescore();
System.out.println("請輸入要修改的科目:");intt;
t=scanner.nextInt();switch(t)
{case 1:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后的高等數學成績:");
s[i].setMathematicsscore(scanner.nextDouble());break;case 2:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后的大學英語成績:");
s[i].setEnglishiscore(scanner.nextDouble());break;case 3:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后的計算機網絡成績:");
s[i].setNetworkscore(scanner.nextDouble());break;case 4:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后數據庫的成績:");
s[i].setDatabasescore(scanner.nextDouble());break;case 5:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后軟件工程的成績:");
s[i].setSoftwarescore(scanner.nextDouble());break;
}
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 1.高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 2.大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 3.計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 4.數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 5.軟件工程成績:"+s[i].getSoftwarescore());
System.out.println(" 該同學成績已經修改完畢,是否提交(Y/N)");
System.out.println("****************************************************");
String n=scanner.next();if(n.equals("Y")){m=1;break;}else{
s[i].setMathematicsscore(x1);
s[i].setEnglishiscore(x2);
s[i].setNetworkscore(x3);
s[i].setDatabasescore(x4);
s[i].setSoftwarescore(x5);break;
}
}else if(i==N-1)
{
System.out.println("該學號不存在");
}
}if(m==1)break;
}
}public static voidjidain()
{int t=0;double mathematicsscore=0;double englishiscore=0;double networkscore=0;double databasescore=0;double softwarescore=0;double pingjun=0;
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績績點計算界面");
System.out.println("****************************************************");
System.out.println(" 請輸入學生學號:");
System.out.println("****************************************************");
String a=scanner.next();for(int i=0;i
{if(a.equals(s[i].getStunumber()))
{if(s[i].getMathematicsscore()>=90)mathematicsscore=4;else if(s[i].getMathematicsscore()>=85&&s[i].getMathematicsscore()<=89.9)mathematicsscore=3.7;else if(s[i].getMathematicsscore()>=82&&s[i].getMathematicsscore()<=84.9)mathematicsscore=3.3;else if(s[i].getMathematicsscore()>=78&&s[i].getMathematicsscore()<=81.9)mathematicsscore=3.0;else if(s[i].getMathematicsscore()>=75&&s[i].getMathematicsscore()<=77.9)mathematicsscore=2.7;else if(s[i].getMathematicsscore()>=72&&s[i].getMathematicsscore()<=74.9)mathematicsscore=2.3;else if(s[i].getMathematicsscore()>=68&&s[i].getMathematicsscore()<=71.9)mathematicsscore=2.0;else if(s[i].getMathematicsscore()>=66&&s[i].getMathematicsscore()<=67.9)mathematicsscore=1.7;else if(s[i].getMathematicsscore()>=64&&s[i].getMathematicsscore()<=65.9)mathematicsscore=1.5;else if(s[i].getMathematicsscore()>=60&&s[i].getMathematicsscore()<=63.9)mathematicsscore=1.0;else if(s[i].getMathematicsscore()<60)mathematicsscore=0;if(s[i].getEnglishiscore()>=90)mathematicsscore=4;else if(s[i].getEnglishiscore()>=85&&s[i].getEnglishiscore()<=89.9)englishiscore=3.7;else if(s[i].getEnglishiscore()>=82&&s[i].getEnglishiscore()<=84.9)englishiscore=3.3;else if(s[i].getEnglishiscore()>=78&&s[i].getEnglishiscore()<=81.9)englishiscore=3.0;else if(s[i].getEnglishiscore()>=75&&s[i].getEnglishiscore()<=77.9)englishiscore=2.7;else if(s[i].getEnglishiscore()>=72&&s[i].getEnglishiscore()<=74.9)englishiscore=2.3;else if(s[i].getEnglishiscore()>=68&&s[i].getEnglishiscore()<=71.9)englishiscore=2.0;else if(s[i].getEnglishiscore()>=66&&s[i].getEnglishiscore()<=67.9)englishiscore=1.7;else if(s[i].getEnglishiscore()>=64&&s[i].getEnglishiscore()<=65.9)englishiscore=1.5;else if(s[i].getEnglishiscore()>=60&&s[i].getEnglishiscore()<=63.9)englishiscore=1.0;else if(s[i].getEnglishiscore()<60)englishiscore=0;if(s[i].getNetworkscore()>=90)networkscore=4;else if(s[i].getNetworkscore()>=85&&s[i].getNetworkscore()<=89.9)networkscore=3.7;else if(s[i].getNetworkscore()>=82&&s[i].getNetworkscore()<=84.9)networkscore=3.3;else if(s[i].getNetworkscore()>=78&&s[i].getNetworkscore()<=81.9)networkscore=3.0;else if(s[i].getNetworkscore()>=75&&s[i].getNetworkscore()<=77.9)networkscore=2.7;else if(s[i].getNetworkscore()>=72&&s[i].getNetworkscore()<=74.9)networkscore=2.3;else if(s[i].getNetworkscore()>=68&&s[i].getNetworkscore()<=71.9)networkscore=2.0;else if(s[i].getNetworkscore()>=66&&s[i].getNetworkscore()<=67.9)networkscore=1.7;else if(s[i].getNetworkscore()>=64&&s[i].getNetworkscore()<=65.9)networkscore=1.5;else if(s[i].getNetworkscore()>=60&&s[i].getNetworkscore()<=63.9)networkscore=1.0;else if(s[i].getNetworkscore()<60)networkscore=0;if(s[i].getDatabasescore()>=90)databasescore=4;else if(s[i].getDatabasescore()>=85&&s[i].getDatabasescore()<=89.9)databasescore=3.7;else if(s[i].getDatabasescore()>=82&&s[i].getDatabasescore()<=84.9)databasescore=3.3;else if(s[i].getDatabasescore()>=78&&s[i].getDatabasescore()<=81.9)databasescore=3.0;else if(s[i].getDatabasescore()>=75&&s[i].getDatabasescore()<=77.9)databasescore=2.7;else if(s[i].getDatabasescore()>=72&&s[i].getDatabasescore()<=74.9)databasescore=2.3;else if(s[i].getDatabasescore()>=68&&s[i].getDatabasescore()<=71.9)databasescore=2.0;else if(s[i].getDatabasescore()>=66&&s[i].getDatabasescore()<=67.9)databasescore=1.7;else if(s[i].getDatabasescore()>=64&&s[i].getDatabasescore()<=65.9)databasescore=1.5;else if(s[i].getDatabasescore()>=60&&s[i].getDatabasescore()<=63.9)databasescore=1.0;else if(s[i].getDatabasescore()<60)databasescore=0;if(s[i].getSoftwarescore()>=90)softwarescore=4;else if(s[i].getSoftwarescore()>=85&&s[i].getSoftwarescore()<=89.9)softwarescore=3.7;else if(s[i].getSoftwarescore()>=82&&s[i].getSoftwarescore()<=84.9)softwarescore=3.3;else if(s[i].getSoftwarescore()>=78&&s[i].getSoftwarescore()<=81.9)softwarescore=3.0;else if(s[i].getSoftwarescore()>=75&&s[i].getSoftwarescore()<=77.9)softwarescore=2.7;else if(s[i].getSoftwarescore()>=72&&s[i].getSoftwarescore()<=74.9)softwarescore=2.3;else if(s[i].getSoftwarescore()>=68&&s[i].getSoftwarescore()<=71.9)softwarescore=2.0;else if(s[i].getSoftwarescore()>=66&&s[i].getSoftwarescore()<=67.9)softwarescore=1.7;else if(s[i].getSoftwarescore()>=64&&s[i].getSoftwarescore()<=65.9)softwarescore=1.5;else if(s[i].getSoftwarescore()>=60&&s[i].getSoftwarescore()<=63.9)softwarescore=1.0;else if(s[i].getSoftwarescore()<60)softwarescore=0;
pingjun=(4*s[i].getMathematicsscore()+3*s[i].getEnglishiscore()+4*s[i].getNetworkscore()+3*s[i].getDatabasescore()+2*s[i].getSoftwarescore())/16;
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績績點計算界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 1.高等數學績點:"+mathematicsscore);
System.out.println(" 2.大學英語績點:"+englishiscore);
System.out.println(" 3.計算機網絡績點:"+networkscore);
System.out.println(" 4.數據庫績點:"+databasescore);
System.out.println(" 5.軟件工程績點:"+softwarescore);
System.out.println("????????????????? 你的平均學分績點為:"+df.format(pingjun));if(pingjun>=2)System.out.println(" 你的學分績點已達到畢業要求!");else System.out.println(" 你的學分績點不滿足畢業要求!");
System.out.println(" 是否返回系統主界面:(Y/N)");
System.out.println("****************************************************");
String c=scanner.next();if(c.equals("Y")){t=1;break;}else break;
}else if(i==N-1)System.out.println("該學號不存在");
}if(t==1)show();
}public static voidmain(String agre[])
{
chushizhi();while(true)
{
show();
}
}
}
---恢復內容結束---
packagexiaoceshi;public classScoreInformation {privateString stunumber;privateString name;private doublemathematicsscore;private doubleenglishiscore;private doublenetworkscore;private doubledatabasescore;private doublesoftwarescore;publicString getStunumber() {returnstunumber;
}public voidsetStunumber(String stunumber) {this.stunumber =stunumber;
}publicString getName() {returnname;
}public voidsetName(String name) {this.name =name;
}public doublegetMathematicsscore() {returnmathematicsscore;
}public void setMathematicsscore(doublemathematicsscore) {this.mathematicsscore =mathematicsscore;
}public doublegetEnglishiscore() {returnenglishiscore;
}public void setEnglishiscore(doubleenglishiscore) {this.englishiscore =englishiscore;
}public doublegetNetworkscore() {returnnetworkscore;
}public void setNetworkscore(doublenetworkscore) {this.networkscore =networkscore;
}public doublegetDatabasescore() {returndatabasescore;
}public void setDatabasescore(doubledatabasescore) {this.databasescore =databasescore;
}public doublegetSoftwarescore() {returnsoftwarescore;
}public void setSoftwarescore(doublesoftwarescore) {this.softwarescore =softwarescore;
}public ScoreInformation(String stunumber,String name,double mathematicsscore,double englishiscore,double networkscore,double databasescore,doublesoftwarescore)
{
}publicScoreInformation() {
}
}
packagexiaoceshi;importjava.util.Scanner;public classScoreManagement {static ScoreInformation s[]=new ScoreInformation[100];static int N=0;static Scanner scanner=newScanner(System.in);public static voidchushizhi(){
s[0]=newScoreInformation();
s[0].setStunumber("20183704");
s[0].setName("趙文軒");
s[0].setMathematicsscore(0);
s[0].setEnglishiscore(0);
s[0].setNetworkscore(0);
s[0].setDatabasescore(0);
s[0].setSoftwarescore(0);
s[1]=newScoreInformation();
s[1].setStunumber("20183705");
s[1].setName("aaa");
s[1].setMathematicsscore(0);
s[1].setEnglishiscore(0);
s[1].setNetworkscore(0);
s[1].setDatabasescore(0);
s[1].setSoftwarescore(0);
s[2]=newScoreInformation();
s[2].setStunumber("20183706");
s[2].setName("bbb");
s[2].setMathematicsscore(0);
s[2].setEnglishiscore(0);
s[2].setNetworkscore(0);
s[2].setDatabasescore(0);
s[2].setSoftwarescore(0);
s[3]=newScoreInformation();
s[3].setStunumber("20183707");
s[3].setName("ccc");
s[3].setMathematicsscore(0);
s[3].setEnglishiscore(0);
s[3].setNetworkscore(0);
s[3].setDatabasescore(0);
s[3].setSoftwarescore(0);
s[4]=newScoreInformation();
s[4].setStunumber("20183708");
s[4].setName("ddd");
s[4].setMathematicsscore(0);
s[4].setEnglishiscore(0);
s[4].setNetworkscore(0);
s[4].setDatabasescore(0);
s[4].setSoftwarescore(0);
N=5;
}public static voidshow()
{
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("請輸入要執行的操作:");int t=scanner.nextInt();if(t<1&&t>4)System.out.println("輸入的錯誤信息");switch(t)
{case 1:input();break;case 2:change();break;case 3:jidain();break;case 4:EXIT();break;
}
}public static voidEXIT()
{
System.out.println("****************************************************");
System.out.println(" 謝謝使用石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 制作人:趙文軒");
System.out.println("****************************************************");
System.exit(-1);
}public static voidinput()
{while (true)
{int t=0;
System.out.println("*****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 請輸入學生學號:********");
System.out.println("****************************************************");
System.out.println("請輸入八位的學號:");
String a=scanner.next();for(int i=0;i
{if(a.equals(s[i].getStunumber()))
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入高等數學成績:");
System.out.println("****************************************************");
s[i].setMathematicsscore(scanner.nextDouble());if(s[i].getMathematicsscore()>0&&s[i].getMathematicsscore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 請輸入大學英語成績:");
System.out.println("****************************************************");
s[i].setEnglishiscore(scanner.nextDouble());if(s[i].getEnglishiscore()>0&&s[i].getEnglishiscore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 請輸入計算機網絡成績:");
System.out.println("****************************************************");
s[i].setNetworkscore(scanner.nextDouble());if(s[i].getNetworkscore()>0&&s[i].getNetworkscore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 請輸入數據庫成績:");
System.out.println("****************************************************");
s[i].setDatabasescore(scanner.nextDouble());if(s[i].getDatabasescore()>0&&s[i].getDatabasescore()<100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 輸入數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 請輸入軟件工程成績:");
System.out.println("****************************************************");
s[i].setSoftwarescore(scanner.nextDouble());if(s[i].getSoftwarescore()>0&&s[i].getSoftwarescore()<=100)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績錄入界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 軟件工程成績:"+s[i].getSoftwarescore());
System.out.println("****************************************************");
System.out.println(" 該學生成績已錄入完畢,是否提交(Y/N)");
String c=scanner.next();if(c.equals("Y"))
{
t=1;break;
}else{
s[i].setMathematicsscore(0);
s[i].setEnglishiscore(0);
s[i].setNetworkscore(0);
s[i].setDatabasescore(0);
s[i].setSoftwarescore(0);break;
}
}else {t=0;break;}
}else {t=0;break;}
}else {t=0;break;}
}else {t=0;break;}
}
}else if(i==N-1)System.out.println("該學號不存在");
}if(t==1)break;
}
}public static voidchange()
{while(true)
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 請輸入學生學號:********");
System.out.println("****************************************************");
String a=scanner.next();inti;int m=0;for(i=0;i
{if(a.equals(s[i].getStunumber()))
{
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 1.高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 2.大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 3.計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 4.數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 5.軟件工程成績:"+s[i].getSoftwarescore());
System.out.println("****************************************************");doublex1,x2,x3,x4,x5;
x1=s[i].getMathematicsscore();
x2=s[i].getEnglishiscore();
x3=s[i].getNetworkscore();
x4=s[i].getDatabasescore();
x5=s[i].getSoftwarescore();
System.out.println("請輸入要修改的科目:");intt;
t=scanner.nextInt();switch(t)
{case 1:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后的高等數學成績:");
s[i].setMathematicsscore(scanner.nextDouble());break;case 2:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后的大學英語成績:");
s[i].setEnglishiscore(scanner.nextDouble());break;case 3:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后的計算機網絡成績:");
s[i].setNetworkscore(scanner.nextDouble());break;case 4:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后數據庫的成績:");
s[i].setDatabasescore(scanner.nextDouble());break;case 5:
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 請輸入修改后軟件工程的成績:");
s[i].setSoftwarescore(scanner.nextDouble());break;
}
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績修改界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 1.高等數學成績:"+s[i].getMathematicsscore());
System.out.println(" 2.大學英語成績:"+s[i].getEnglishiscore());
System.out.println(" 3.計算機網絡成績:"+s[i].getNetworkscore());
System.out.println(" 4.數據庫成績:"+s[i].getDatabasescore());
System.out.println(" 5.軟件工程成績:"+s[i].getSoftwarescore());
System.out.println(" 該同學成績已經修改完畢,是否提交(Y/N)");
System.out.println("****************************************************");
String n=scanner.next();if(n.equals("Y")){m=1;break;}else{
s[i].setMathematicsscore(x1);
s[i].setEnglishiscore(x2);
s[i].setNetworkscore(x3);
s[i].setDatabasescore(x4);
s[i].setSoftwarescore(x5);break;
}
}else if(i==N-1)
{
System.out.println("該學號不存在");
}
}if(m==1)break;
}
}public static voidjidain()
{int t=0;double mathematicsscore=0;double englishiscore=0;double networkscore=0;double databasescore=0;double softwarescore=0;double pingjun=0;
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績績點計算界面");
System.out.println("****************************************************");
System.out.println(" 請輸入學生學號:");
System.out.println("****************************************************");
String a=scanner.next();for(int i=0;i
{if(a.equals(s[i].getStunumber()))
{if(s[i].getMathematicsscore()>=90)mathematicsscore=4;else if(s[i].getMathematicsscore()>=85&&s[i].getMathematicsscore()<=89.9)mathematicsscore=3.7;else if(s[i].getMathematicsscore()>=82&&s[i].getMathematicsscore()<=84.9)mathematicsscore=3.3;else if(s[i].getMathematicsscore()>=78&&s[i].getMathematicsscore()<=81.9)mathematicsscore=3.0;else if(s[i].getMathematicsscore()>=75&&s[i].getMathematicsscore()<=77.9)mathematicsscore=2.7;else if(s[i].getMathematicsscore()>=72&&s[i].getMathematicsscore()<=74.9)mathematicsscore=2.3;else if(s[i].getMathematicsscore()>=68&&s[i].getMathematicsscore()<=71.9)mathematicsscore=2.0;else if(s[i].getMathematicsscore()>=66&&s[i].getMathematicsscore()<=67.9)mathematicsscore=1.7;else if(s[i].getMathematicsscore()>=64&&s[i].getMathematicsscore()<=65.9)mathematicsscore=1.5;else if(s[i].getMathematicsscore()>=60&&s[i].getMathematicsscore()<=63.9)mathematicsscore=1.0;else if(s[i].getMathematicsscore()<60)mathematicsscore=0;if(s[i].getEnglishiscore()>=90)mathematicsscore=4;else if(s[i].getEnglishiscore()>=85&&s[i].getEnglishiscore()<=89.9)englishiscore=3.7;else if(s[i].getEnglishiscore()>=82&&s[i].getEnglishiscore()<=84.9)englishiscore=3.3;else if(s[i].getEnglishiscore()>=78&&s[i].getEnglishiscore()<=81.9)englishiscore=3.0;else if(s[i].getEnglishiscore()>=75&&s[i].getEnglishiscore()<=77.9)englishiscore=2.7;else if(s[i].getEnglishiscore()>=72&&s[i].getEnglishiscore()<=74.9)englishiscore=2.3;else if(s[i].getEnglishiscore()>=68&&s[i].getEnglishiscore()<=71.9)englishiscore=2.0;else if(s[i].getEnglishiscore()>=66&&s[i].getEnglishiscore()<=67.9)englishiscore=1.7;else if(s[i].getEnglishiscore()>=64&&s[i].getEnglishiscore()<=65.9)englishiscore=1.5;else if(s[i].getEnglishiscore()>=60&&s[i].getEnglishiscore()<=63.9)englishiscore=1.0;else if(s[i].getEnglishiscore()<60)englishiscore=0;if(s[i].getNetworkscore()>=90)networkscore=4;else if(s[i].getNetworkscore()>=85&&s[i].getNetworkscore()<=89.9)networkscore=3.7;else if(s[i].getNetworkscore()>=82&&s[i].getNetworkscore()<=84.9)networkscore=3.3;else if(s[i].getNetworkscore()>=78&&s[i].getNetworkscore()<=81.9)networkscore=3.0;else if(s[i].getNetworkscore()>=75&&s[i].getNetworkscore()<=77.9)networkscore=2.7;else if(s[i].getNetworkscore()>=72&&s[i].getNetworkscore()<=74.9)networkscore=2.3;else if(s[i].getNetworkscore()>=68&&s[i].getNetworkscore()<=71.9)networkscore=2.0;else if(s[i].getNetworkscore()>=66&&s[i].getNetworkscore()<=67.9)networkscore=1.7;else if(s[i].getNetworkscore()>=64&&s[i].getNetworkscore()<=65.9)networkscore=1.5;else if(s[i].getNetworkscore()>=60&&s[i].getNetworkscore()<=63.9)networkscore=1.0;else if(s[i].getNetworkscore()<60)networkscore=0;if(s[i].getDatabasescore()>=90)databasescore=4;else if(s[i].getDatabasescore()>=85&&s[i].getDatabasescore()<=89.9)databasescore=3.7;else if(s[i].getDatabasescore()>=82&&s[i].getDatabasescore()<=84.9)databasescore=3.3;else if(s[i].getDatabasescore()>=78&&s[i].getDatabasescore()<=81.9)databasescore=3.0;else if(s[i].getDatabasescore()>=75&&s[i].getDatabasescore()<=77.9)databasescore=2.7;else if(s[i].getDatabasescore()>=72&&s[i].getDatabasescore()<=74.9)databasescore=2.3;else if(s[i].getDatabasescore()>=68&&s[i].getDatabasescore()<=71.9)databasescore=2.0;else if(s[i].getDatabasescore()>=66&&s[i].getDatabasescore()<=67.9)databasescore=1.7;else if(s[i].getDatabasescore()>=64&&s[i].getDatabasescore()<=65.9)databasescore=1.5;else if(s[i].getDatabasescore()>=60&&s[i].getDatabasescore()<=63.9)databasescore=1.0;else if(s[i].getDatabasescore()<60)databasescore=0;if(s[i].getSoftwarescore()>=90)softwarescore=4;else if(s[i].getSoftwarescore()>=85&&s[i].getSoftwarescore()<=89.9)softwarescore=3.7;else if(s[i].getSoftwarescore()>=82&&s[i].getSoftwarescore()<=84.9)softwarescore=3.3;else if(s[i].getSoftwarescore()>=78&&s[i].getSoftwarescore()<=81.9)softwarescore=3.0;else if(s[i].getSoftwarescore()>=75&&s[i].getSoftwarescore()<=77.9)softwarescore=2.7;else if(s[i].getSoftwarescore()>=72&&s[i].getSoftwarescore()<=74.9)softwarescore=2.3;else if(s[i].getSoftwarescore()>=68&&s[i].getSoftwarescore()<=71.9)softwarescore=2.0;else if(s[i].getSoftwarescore()>=66&&s[i].getSoftwarescore()<=67.9)softwarescore=1.7;else if(s[i].getSoftwarescore()>=64&&s[i].getSoftwarescore()<=65.9)softwarescore=1.5;else if(s[i].getSoftwarescore()>=60&&s[i].getSoftwarescore()<=63.9)softwarescore=1.0;else if(s[i].getSoftwarescore()<60)softwarescore=0;
pingjun=(4*s[i].getMathematicsscore()+3*s[i].getEnglishiscore()+4*s[i].getNetworkscore()+3*s[i].getDatabasescore()+2*s[i].getSoftwarescore())/16;
System.out.println("****************************************************");
System.out.println(" 石家莊鐵道大學軟件工程系學生學籍管理系統2019版");
System.out.println(" 學生考試成績績點計算界面");
System.out.println("****************************************************");
System.out.println(" 學生學號:"+s[i].getStunumber());
System.out.println(" 學生姓名:"+s[i].getName());
System.out.println(" 1.高等數學績點:"+mathematicsscore);
System.out.println(" 2.大學英語績點:"+englishiscore);
System.out.println(" 3.計算機網絡績點:"+networkscore);
System.out.println(" 4.數據庫績點:"+databasescore);
System.out.println(" 5.軟件工程績點:"+softwarescore);
System.out.println(" 你的平均學分績點為:"+pingjun);if(pingjun>=2)System.out.println(" 你的學分績點已達到畢業要求!");else System.out.println(" 你的學分績點不滿足畢業要求!");
System.out.println(" 是否返回系統主界面:(Y/N)");
System.out.println("****************************************************");
String c=scanner.next();if(c.equals("Y")){t=1;break;}else break;
}else if(i==N-1)System.out.println("該學號不存在");
}if(t==1)show();
}public static voidmain(String agre[])
{
chushizhi();while(true)
{
show();
}
}
}
總結
以上是生活随笔為你收集整理的java计算并显示学生的成绩_Java开学测试-学生成绩管理系统的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java线程同步的死锁_Java基础之线
- 下一篇: oracle 查询spid,查看数据库s