java课堂测试样卷-----简易学籍管理系统
程序設(shè)計(jì)思路:分別建立兩個(gè)類:ScoreInformation類(用來定義學(xué)生的基本信息以及設(shè)置set和get函數(shù))ScoreManagement類(用來定義實(shí)現(xiàn)學(xué)生考試成績(jī)錄入,考試成績(jī)修改,績(jī)點(diǎn)計(jì)算等功能的函數(shù))和一個(gè)主函數(shù)Text類 (通過輸入的數(shù)字選項(xiàng)進(jìn)行功能的實(shí)現(xiàn),因?yàn)橥顺鱿到y(tǒng)代碼量極少,所以在主函數(shù)中實(shí)現(xiàn)此功能)
程序源代碼及注釋
ScoreInformation類:
1 //信1805-3 20183658 王兵兵 2 package adc; 3 4 public class ScoreInformation 5 { 6 private String stunumber; //學(xué)生學(xué)號(hào) 7 private String name; //學(xué)生姓名 8 private double mathematicsscore; //高等數(shù)學(xué) 9 private double englishscore; //大學(xué)英語 10 private double networkscore; //計(jì)算機(jī)網(wǎng)絡(luò) 11 private double databasescore; //數(shù)據(jù)庫 12 private double softwarescore; //軟件工程 13 ScoreInformation(String stunumber,String name,double mathematicsscore,double englishscore,double networkscore,double databasescore, double softwarescore) 14 { //通過構(gòu)造函數(shù)默認(rèn)賦值 15 this.stunumber=stunumber; 16 this.name=name; 17 this.mathematicsscore=mathematicsscore; 18 this.englishscore=englishscore; 19 this.networkscore=networkscore; 20 this.databasescore=databasescore; 21 this.softwarescore=softwarescore; 22 } 23 public void setstunumber(String stunumber) //對(duì)學(xué)生的學(xué)號(hào)進(jìn)行賦值操作 24 { 25 this.stunumber=stunumber; 26 } 27 public void setname(String name) //對(duì)學(xué)生的姓名進(jìn)行賦值操作 28 { 29 this.name=name; 30 } 31 public void setmathematicsscore(double mathematicsscore) //對(duì)學(xué)生的高等數(shù)學(xué)成績(jī)進(jìn)行賦值操作 32 { 33 this.mathematicsscore=mathematicsscore; 34 } 35 public void setenglishscore(double englishscore) //對(duì)學(xué)生的大學(xué)英語成績(jī)進(jìn)行賦值操作 36 { 37 this.englishscore=englishscore; 38 } 39 public void setnetworkscore(double networkscore) //對(duì)學(xué)生的計(jì)算機(jī)網(wǎng)絡(luò)成績(jī)進(jìn)行賦值操作 40 { 41 this.networkscore=networkscore; 42 } 43 public void setdatabasescore(double databasescore) //對(duì)學(xué)生的數(shù)據(jù)庫成績(jī)進(jìn)行賦值操作 44 { 45 this.databasescore=databasescore; 46 } 47 public void setsoftwarescore(double softwarescore) //對(duì)學(xué)生的軟件工程成績(jī)進(jìn)行賦值操作 48 { 49 this.softwarescore=softwarescore; 50 } 51 public String getstunumber() //返回學(xué)生的學(xué)號(hào) 52 { 53 return this.stunumber; 54 } 55 public String getname() //返回學(xué)生的姓名 56 { 57 return this.name; 58 } 59 public double getmathematicsscore() //返回學(xué)生的高等數(shù)學(xué)成績(jī) 60 { 61 return this.mathematicsscore; 62 } 63 public double getenglishscore() //返回學(xué)生的大學(xué)英語成績(jī) 64 { 65 return this.englishscore; 66 } 67 public double getnetworkscore() //返回學(xué)生的計(jì)算機(jī)網(wǎng)絡(luò)成績(jī) 68 { 69 return this.networkscore; 70 } 71 public double getdatabasescore() //返回學(xué)生的數(shù)據(jù)庫成績(jī) 72 { 73 return this.databasescore; 74 } 75 public double getsoftwarescore() //返回學(xué)生的軟件工程成績(jī) 76 { 77 return this.softwarescore; 78 } 79 80 }
?
ScoreManagement類
1 package adc; 2 import java.util.Scanner; 3 public class ScoreMangerment 4 { 5 int j=0; 6 Scanner te=new Scanner(System.in); 7 ScoreInformation[] SI=new ScoreInformation[100]; //定義一個(gè)學(xué)生學(xué)籍信息的數(shù)組 8 ScoreMangerment() 9 { //利用構(gòu)造函數(shù)初始化5個(gè)學(xué)生的信息 10 SI[0]=new ScoreInformation("20183658","王兵兵",0,0,0,0,0); 11 SI[1]=new ScoreInformation("20183659","張三",0,0,0,0,0); 12 SI[2]=new ScoreInformation("20183660","李四",0,0,0,0,0); 13 SI[3]=new ScoreInformation("20183661","王無",0,0,0,0,0); 14 SI[4]=new ScoreInformation("20183662","李六",0,0,0,0,0); 15 } 16 public void meau() //輸出系統(tǒng)主界面函數(shù) 17 { 18 System.out.println("********************************************************"); 19 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系"); 20 System.out.println(" \t學(xué)籍管理系統(tǒng)系統(tǒng)2019版"); 21 System.out.println("********************************************************"); 22 System.out.println(" 1、學(xué)生考試成績(jī)錄入"); 23 System.out.println(" 2、學(xué)生考試成績(jī)修改"); 24 System.out.println(" 3、計(jì)算學(xué)生成績(jī)績(jī)點(diǎn)"); 25 System.out.println(" 4、退出學(xué)籍管理系統(tǒng)"); 26 System.out.println("********************************************************"); 27 } 28 public void scorerecord() //功能1:實(shí)現(xiàn)學(xué)生信息的錄入 29 { 30 System.out.println("********************************************************"); 31 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 32 System.out.println(" \t考生成績(jī)錄入"); 33 System.out.println("********************************************************"); 34 System.out.println(" 請(qǐng)輸入考生學(xué)號(hào):"); 35 System.out.println("********************************************************"); 36 while(!getanswer()) //用來保證學(xué)生的輸入的學(xué)號(hào)存在,否則一直輸入,直到輸入學(xué)生學(xué)號(hào)存在為止 37 { 38 System.out.println("你輸入的學(xué)號(hào)有誤或不存在!"); 39 System.out.println("********************************************************"); 40 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 41 System.out.println(" \t考生成績(jī)錄入"); 42 System.out.println("********************************************************"); 43 System.out.println(" 請(qǐng)輸入考生學(xué)號(hào):"); 44 System.out.println("********************************************************"); 45 } 46 scoreluruPrint1(j); 47 while(!pandun1()) //輸入Y或N時(shí)對(duì)應(yīng)的程序操作 48 { 49 scoreluruPrint1(j); //輸入N返回錄入界面 50 } 51 meau(); //輸入Y后返回主界面 52 } 53 public Boolean getanswer() //檢查學(xué)號(hào)是否存在 54 { 55 String a=te.next(); 56 Boolean temp=false; 57 for(int i=0;i<5;i++) 58 { 59 if(a.equals(SI[i].getstunumber())) 60 { 61 temp=true; 62 j=i; 63 break; 64 } 65 } 66 return temp; 67 } 68 public void scoreluruPrint1(int j) //實(shí)現(xiàn)學(xué)生成績(jī)信息的輸入,并且在輸入完一科成績(jī)后進(jìn)行學(xué)生信息的更新 69 { 70 System.out.println("********************************************************"); 71 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 72 System.out.println(" \t考生成績(jī)錄入"); 73 System.out.println("********************************************************"); 74 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 75 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 76 System.out.println(" 請(qǐng)輸入高等數(shù)學(xué)成績(jī):"); 77 System.out.println("********************************************************"); 78 SI[5]=new ScoreInformation(" "," ",0,0,0,0,0); 79 SI[5].setstunumber(SI[j].getstunumber()); 80 SI[5].setname(SI[j].getname()); 81 double temp1=te.nextDouble(); 82 SI[5].setmathematicsscore(temp1); 83 System.out.println("********************************************************"); 84 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 85 System.out.println(" \t考生成績(jī)錄入"); 86 System.out.println("********************************************************"); 87 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[5].getstunumber()); 88 System.out.println(" 學(xué)生姓名:"+SI[5].getname()); 89 System.out.println(" 高等數(shù)學(xué)成績(jī) :"+SI[5].getmathematicsscore()); 90 System.out.println(" 請(qǐng)輸入大學(xué)英語成績(jī):"); 91 System.out.println("********************************************************"); 92 double temp2=te.nextDouble(); 93 SI[5].setenglishscore(temp2); 94 System.out.println("********************************************************"); 95 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 96 System.out.println(" \t考生成績(jī)錄入"); 97 System.out.println("********************************************************"); 98 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[5].getstunumber()); 99 System.out.println(" 學(xué)生姓名:"+SI[5].getname()); 100 System.out.println(" 高等數(shù)學(xué)成績(jī) :"+SI[5].getmathematicsscore()); 101 System.out.println(" 大學(xué)英語成績(jī):"+SI[5].getenglishscore()); 102 System.out.println(" 請(qǐng)輸入計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"); 103 System.out.println("********************************************************"); 104 double temp3=te.nextDouble(); 105 SI[5].setnetworkscore(temp3); 106 System.out.println("********************************************************"); 107 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 108 System.out.println(" \t考生成績(jī)錄入"); 109 System.out.println("********************************************************"); 110 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[5].getstunumber()); 111 System.out.println(" 學(xué)生姓名:"+SI[5].getname()); 112 System.out.println(" 高等數(shù)學(xué)成績(jī) :"+SI[5].getmathematicsscore()); 113 System.out.println(" 大學(xué)英語成績(jī):"+SI[5].getenglishscore()); 114 System.out.println(" 計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"+SI[5].getnetworkscore()); 115 System.out.println(" 請(qǐng)輸入數(shù)據(jù)庫成績(jī):"); 116 System.out.println("********************************************************"); 117 double temp4=te.nextDouble(); 118 SI[5].setdatabasescore(temp4); 119 System.out.println("********************************************************"); 120 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 121 System.out.println(" \t考生成績(jī)錄入"); 122 System.out.println("********************************************************"); 123 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[5].getstunumber()); 124 System.out.println(" 學(xué)生姓名:"+SI[5].getname()); 125 System.out.println(" 高等數(shù)學(xué)成績(jī) :"+SI[5].getmathematicsscore()); 126 System.out.println(" 大學(xué)英語成績(jī):"+SI[5].getenglishscore()); 127 System.out.println(" 計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"+SI[5].getnetworkscore()); 128 System.out.println(" 數(shù)據(jù)庫成績(jī):"+SI[5].getdatabasescore()); 129 System.out.println(" 請(qǐng)輸入軟件工程成績(jī):"); 130 System.out.println("********************************************************"); 131 double temp5=te.nextDouble(); 132 SI[5].setsoftwarescore(temp5); 133 System.out.println("********************************************************"); 134 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 135 System.out.println(" \t考生成績(jī)錄入"); 136 System.out.println("********************************************************"); 137 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[5].getstunumber()); 138 System.out.println(" 學(xué)生姓名:"+SI[5].getname()); 139 System.out.println(" 高等數(shù)學(xué)成績(jī) :"+SI[5].getmathematicsscore()); 140 System.out.println(" 大學(xué)英語成績(jī):"+SI[5].getenglishscore()); 141 System.out.println(" 計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"+SI[5].getnetworkscore()); 142 System.out.println(" 數(shù)據(jù)庫成績(jī):"+SI[5].getdatabasescore()); 143 System.out.println(" 軟件工程成績(jī):"+SI[5].getsoftwarescore()); 144 System.out.println(" 該學(xué)生生成績(jī)已錄入完畢,是否提交(Y/N)"); 145 System.out.println("********************************************************"); 146 } 147 public Boolean pandun1() //輸入Y或N并返回Boolean值 148 { 149 String temp6=te.next(); 150 if(temp6.equals("Y")) 151 { 152 SI[j]=SI[5]; 153 return true; 154 } 155 else 156 { 157 return false; 158 } 159 } 160 public void modifyscore() //功能2:實(shí)現(xiàn)學(xué)生成績(jī)的修改 161 { 162 System.out.println("********************************************************"); 163 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 164 System.out.println(" \t考生成績(jī)修改界面"); 165 System.out.println("********************************************************"); 166 System.out.println(" 請(qǐng)輸入考生學(xué)號(hào):"); 167 System.out.println("********************************************************"); 168 while(!getanswer()) //通過while 判斷輸入的學(xué)號(hào)是否存在 169 { 170 System.out.println("你輸入的學(xué)號(hào)有誤或不存在!"); 171 System.out.println("********************************************************"); 172 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 173 System.out.println(" \t考生成績(jī)修改界面"); 174 System.out.println("********************************************************"); 175 System.out.println(" 請(qǐng)輸入考生學(xué)號(hào):"); 176 System.out.println("********************************************************"); 177 } 178 System.out.println("********************************************************"); //輸出學(xué)生的全部信息 179 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 180 System.out.println(" \t考生成績(jī)錄入"); 181 System.out.println("********************************************************"); 182 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 183 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 184 System.out.println(" 1、高等數(shù)學(xué)成績(jī) :"+SI[j].getmathematicsscore()); 185 System.out.println(" 2、大學(xué)英語成績(jī):"+SI[j].getenglishscore()); 186 System.out.println(" 3、計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"+SI[j].getnetworkscore()); 187 System.out.println(" 4、數(shù)據(jù)庫成績(jī):"+SI[j].getdatabasescore()); 188 System.out.println(" 5、軟件工程成績(jī):"+SI[j].getsoftwarescore()); 189 System.out.println("********************************************************"); 190 modifyspecialscore(); //修改成績(jī) 191 System.out.println("********************************************************"); 192 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 193 System.out.println(" \t考生成績(jī)錄入"); 194 System.out.println("********************************************************"); 195 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[6].getstunumber()); 196 System.out.println(" 學(xué)生姓名:"+SI[6].getname()); 197 System.out.println(" 1、高等數(shù)學(xué)成績(jī) :"+SI[6].getmathematicsscore()); 198 System.out.println(" 2、大學(xué)英語成績(jī):"+SI[6].getenglishscore()); 199 System.out.println(" 3、計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"+SI[6].getnetworkscore()); 200 System.out.println(" 4、數(shù)據(jù)庫成績(jī):"+SI[6].getdatabasescore()); 201 System.out.println(" 5、軟件工程成績(jī):"+SI[6].getsoftwarescore()); 202 System.out.println(" 該學(xué)生生成績(jī)已錄入完畢,是否提交(Y/N)"); 203 System.out.println("********************************************************"); 204 while(!pandun2()) 205 { 206 modifyscore() ; 207 } 208 meau(); 209 } 210 public void modifyspecialscore() //修改選定的成績(jī) 211 { 212 SI[6]=new ScoreInformation(" "," ",0,0,0,0,0); 213 SI[6]=SI[j]; 214 System.out.println("請(qǐng)輸入你要修改的成績(jī)對(duì)應(yīng)的數(shù)字選項(xiàng):"); 215 int temp7=te.nextInt(); 216 if(temp7==1) 217 { 218 System.out.println("********************************************************"); 219 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 220 System.out.println(" \t考生成績(jī)錄入"); 221 System.out.println("********************************************************"); 222 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 223 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 224 System.out.println(" 請(qǐng)輸入修改后高等數(shù)學(xué)成績(jī) :"); 225 System.out.println("********************************************************"); 226 double index1=te.nextDouble(); 227 SI[6].setmathematicsscore(index1); 228 } 229 else if(temp7==2) 230 { 231 System.out.println("********************************************************"); 232 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 233 System.out.println(" \t考生成績(jī)錄入"); 234 System.out.println("*******************************************************"); 235 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 236 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 237 System.out.println(" 請(qǐng)輸入修改后大學(xué)英語成績(jī) :"); 238 System.out.println("********************************************************"); 239 double index2=te.nextDouble(); 240 SI[6].setenglishscore(index2); 241 } 242 else if(temp7==3) 243 { 244 System.out.println("********************************************************"); 245 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 246 System.out.println(" \t考生成績(jī)錄入"); 247 System.out.println("*******************************************************"); 248 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 249 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 250 System.out.println(" 請(qǐng)輸入修改后計(jì)算機(jī)網(wǎng)絡(luò)成績(jī) :"); 251 System.out.println("********************************************************"); 252 double index3=te.nextDouble(); 253 SI[6].setnetworkscore(index3); 254 } 255 else if(temp7==4) 256 { 257 System.out.println("********************************************************"); 258 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 259 System.out.println(" \t考生成績(jī)錄入"); 260 System.out.println("*******************************************************"); 261 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 262 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 263 System.out.println(" 請(qǐng)輸入修改后數(shù)據(jù)庫成績(jī) :"); 264 System.out.println("********************************************************"); 265 double index4=te.nextDouble(); 266 SI[6].setdatabasescore(index4); 267 } 268 else if(temp7==5) 269 { 270 System.out.println("********************************************************"); 271 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 272 System.out.println(" \t考生成績(jī)錄入"); 273 System.out.println("*******************************************************"); 274 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 275 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 276 System.out.println(" 請(qǐng)輸入修改后軟件工程成績(jī) :"); 277 System.out.println("********************************************************"); 278 double index5=te.nextDouble(); 279 SI[6].setsoftwarescore(index5); 280 } 281 } 282 public Boolean pandun2() //輸入Y或N并返回Boolean值 283 { 284 String temp8=te.next(); 285 if(temp8.equals("Y")) 286 { 287 SI[j]=SI[6]; 288 return true; 289 } 290 else 291 { 292 return false; 293 } 294 } 295 public void calulatescorepoint() //功能3:計(jì)算學(xué)生考試成績(jī)對(duì)應(yīng)的績(jī)點(diǎn) 296 { 297 System.out.println("********************************************************"); 298 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 299 System.out.println(" \t學(xué)生考試成績(jī)績(jī)點(diǎn)計(jì)算界面"); 300 System.out.println("********************************************************"); 301 System.out.println(" 請(qǐng)輸入考生學(xué)號(hào):"); 302 System.out.println("********************************************************"); 303 while(!getanswer()) 304 { 305 System.out.println("你輸入的學(xué)號(hào)有誤或不存在!"); 306 System.out.println("********************************************************"); 307 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 308 System.out.println(" \t考生成績(jī)錄入"); 309 System.out.println("********************************************************"); 310 System.out.println(" 請(qǐng)輸入考生學(xué)號(hào):"); 311 System.out.println("********************************************************"); 312 } 313 System.out.println("********************************************************"); 314 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 315 System.out.println(" \t學(xué)生成績(jī)績(jī)點(diǎn)計(jì)算界面"); 316 System.out.println("********************************************************"); 317 System.out.println(" 學(xué)生學(xué)號(hào):"+SI[j].getstunumber()); 318 System.out.println(" 學(xué)生姓名:"+SI[j].getname()); 319 System.out.println(" 1、高等數(shù)學(xué)成績(jī) :"+SI[j].getmathematicsscore()); 320 System.out.println(" 2、大學(xué)英語成績(jī):"+SI[j].getenglishscore()); 321 System.out.println(" 3、計(jì)算機(jī)網(wǎng)絡(luò)成績(jī):"+SI[j].getnetworkscore()); 322 System.out.println(" 4、數(shù)據(jù)庫成績(jī):"+SI[j].getdatabasescore()); 323 System.out.println(" 5、軟件工程成績(jī):"+SI[j].getsoftwarescore()); 324 concullate(); 325 System.out.println(" 是否返回主界面(Y/N)"); 326 System.out.println("********************************************************"); 327 pandun3(); 328 } 329 public void concullate() //判斷學(xué)生績(jī)點(diǎn)是否滿足畢業(yè)要求 330 { double sum=0; 331 sum+=scorepoint(SI[j].getmathematicsscore())*5.0; 332 sum+=scorepoint(SI[j].getenglishscore())*3.0; 333 sum+=scorepoint(SI[j].getnetworkscore())*4.0; 334 sum+=scorepoint(SI[j].getdatabasescore())*3.0; 335 sum+=scorepoint(SI[j].getsoftwarescore())*4.0; 336 sum=sum/19; 337 String result=String.format("%.2f", sum); 338 System.out.println(" 你的平均學(xué)分績(jī)點(diǎn)為:"+result); 339 if(sum>=2.0) 340 System.out.println(" 提示信息:你的學(xué)分績(jī)點(diǎn)已達(dá)到畢業(yè)要求!"); 341 else 342 System.out.println(" 提示信息:你的學(xué)分績(jī)點(diǎn)不滿足畢業(yè)要求!"); 343 } 344 public double scorepoint(double sdc) //返回學(xué)生成績(jī)對(duì)應(yīng)的績(jī)點(diǎn) 345 { 346 double index0=0; 347 if(sdc<60) 348 { 349 index0=0; 350 } 351 else if(sdc>=60&&sdc<=63.9) 352 { 353 index0=1.0; 354 } 355 else if(sdc>=64&&sdc<=65.9) 356 { 357 index0=1.5; 358 } 359 else if(sdc>=66&&sdc<=67.9) 360 { 361 index0=1.7; 362 } 363 else if(sdc>=68&&sdc<=71.9) 364 { 365 index0=2.0; 366 } 367 else if(sdc>=72&&sdc<=74.9) 368 { 369 index0=2.3; 370 } 371 else if(sdc>=75&&sdc<=77.9) 372 { 373 index0=2.7; 374 } 375 else if(sdc>=78&&sdc<=81.9) 376 { 377 index0=3.0; 378 } 379 else if(sdc>=82&&sdc<=84.9) 380 { 381 index0=3.3; 382 } 383 else if(sdc>=85&&sdc<=88.9) 384 { 385 index0=3.7; 386 } 387 else 388 index0=4.0; 389 return index0; 390 } 391 public void pandun3() //輸入Y或N后進(jìn)行相應(yīng)的操作 392 { 393 String temp9=te.next(); 394 if(temp9.equals("Y")) 395 { 396 meau(); 397 } 398 else; 399 } 400 }
?
主函數(shù)
1 package adc; 2 import java.util.*; 3 public class Text { 4 5 public static void main(String[] args) 6 { 7 Scanner input=new Scanner(System.in); 8 ScoreMangerment SM=new ScoreMangerment(); 9 SM.meau(); //顯示系統(tǒng)主界面 10 while(true) 11 { 12 int a=input.nextInt(); 13 if(a==1) 14 { 15 SM.scorerecord(); //調(diào)用成績(jī)錄入函數(shù) 16 17 } 18 else if(a==2) 19 { 20 SM.modifyscore(); //調(diào)用成績(jī)修改函數(shù) 21 } 22 else if(a==3) 23 { 24 SM.calulatescorepoint(); //調(diào)用計(jì)算學(xué)生績(jī)點(diǎn)函數(shù) 25 } 26 else if(a==4) //退出系統(tǒng) 27 { 28 System.out.println("********************************************************"); 29 System.out.println(" \t石家莊鐵道大學(xué)軟件工程系學(xué)籍管理2019版"); 30 System.out.println(" \t制作人:王兵兵"); 31 System.out.println("********************************************************"); 32 break; 33 } 34 else //防止輸入的選項(xiàng)不存在 35 { 36 System.out.println("該選項(xiàng)不存在!"); 37 SM.meau(); 38 } 39 } 40 input.close(); 41 } 42 43 }
?
心得體會(huì):在寫復(fù)雜且代碼量龐大的程序時(shí),一定要保證自己的邏輯思維清楚,一旦混亂,就會(huì)條理不清,調(diào)試尋找代碼錯(cuò)誤就會(huì)花費(fèi)很長(zhǎng)時(shí)間,所以邏輯思維很重要。
再者自己要保持良好的心態(tài),一定要把題讀懂讀透,不要看一遍題后就立即開始做,先構(gòu)造下自己的思路和框架。
最后就是基本功不扎實(shí):對(duì)鍵盤不熟悉,敲代碼的速度過慢以及準(zhǔn)確率低,日后要多加練習(xí)。
轉(zhuǎn)載于:https://www.cnblogs.com/weixiao1717/p/11506441.html
總結(jié)
以上是生活随笔為你收集整理的java课堂测试样卷-----简易学籍管理系统的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c# .netframwork 4.0
- 下一篇: 求一个qq网名女生闺蜜三人。