學生管理系統。JAVA

 1 package 做業;  2 
 3 import java.io.IOException;  4 import java.util.Scanner;  5 
 6 public class zuoye {  7 
 8 public static void main(String[]args) {  9 Scoreinformation []stu;  10 stu=new Scoreinformation [5];  11 
 12 stu[0]=new Scoreinformation(20183578,"鄭磊",0,0,0,0,0);  13 stu[1]=new Scoreinformation(20183571,"路人甲",0,0,0,0,0);  14 stu[2]=new Scoreinformation(20183572,"路人乙",0,0,0,0,0);  15 stu[3]=new Scoreinformation(20183573,"路人丙",0,0,0,0,0);  16 stu[4]=new Scoreinformation(20183574,"路人丁",0,0,0,0,0);  17 jie();  18 Scanner in=new Scanner(System.in);  19 int a=in.nextInt();  20 int flag=0;  21 int nm=0;  22 switch (a) {  23 case 1: {  24 
 25 System.out.println("***********************************************************");  26 System.out.println(" 石家莊鐵道大學軟件工程系 ");  27 System.out.println(" 學生學籍管理系統 2019 版 ");  28 System.out.println("***********************************************************");  29 System.out.println(" 請輸入學生學號: ");  30 System.out.println("***********************************************************");  31 int stud1=in.nextInt();  32 for(int i=0;i<5;i++)  33 { if (stud1==stu[i].stunumber)  34 {flag=1;  35 nm=i;}  36 }  37 if(flag==0)  38 { System.out.println("學號不存在");  39 
 40 }  41 else {  42 System.out.println("***********************************************************");  43 System.out.println(" 石家莊鐵道大學軟件工程系 ");  44 System.out.println(" 學生學籍管理系統 2019 版 ");  45 System.out.println("***********************************************************");  46 System.out.println(" 學生學號: "+stud1);  47 System.out.println(" 學生姓名: "+stu[nm].name);  48 System.out.println(" 請輸入高等數學成績: ");  49 System.out.println("***********************************************************");  50 double stud2=in.nextDouble();  51 stu[nm].mathematicsscore=stud2;  52 System.out.println("***********************************************************");  53 System.out.println(" 石家莊鐵道大學軟件工程系 ");  54 System.out.println(" 學生學籍管理系統 2019 版 ");  55 System.out.println("***********************************************************");  56 System.out.println(" 學生學號: "+stud1);  57 System.out.println(" 學生姓名: "+stu[nm].name);  58 System.out.println(" 高等數學成績:"+stud2);  59 System.out.println(" 請輸入大學英語成績: ");  60 System.out.println("***********************************************************");  61 double stud3=in.nextDouble();  62 stu[nm].englishiscore=stud3;  63 System.out.println("***********************************************************");  64 System.out.println(" 石家莊鐵道大學軟件工程系 ");  65 System.out.println(" 學生學籍管理系統 2019 版 ");  66 System.out.println("***********************************************************");  67 System.out.println(" 學生學號: "+stud1);  68 System.out.println(" 學生姓名: "+stu[nm].name);  69 System.out.println(" 高等數學成績:"+stud2);  70 System.out.println(" 大學英語成績:"+stud3);  71 System.out.println(" 請輸入計算機網絡成績: ");  72 System.out.println("***********************************************************");  73 double stud4=in.nextDouble();  74 stu[nm].networkscore=stud4;  75 System.out.println("***********************************************************");  76 System.out.println(" 石家莊鐵道大學軟件工程系 ");  77 System.out.println(" 學生學籍管理系統 2019 版 ");  78 System.out.println("***********************************************************");  79 System.out.println(" 學生學號: "+stud1);  80 System.out.println(" 學生姓名: "+stu[nm].name);  81 System.out.println(" 高等數學成績:"+stud2);  82 System.out.println(" 大學英語成績:"+stud3);  83 System.out.println(" 計算機網絡成績:"+stud4);  84 System.out.println(" 請輸入數據庫成績: ");  85 System.out.println("***********************************************************");  86 double stud5=in.nextDouble();  87 stu[nm].databasescore=stud5;  88 System.out.println("***********************************************************");  89 System.out.println(" 石家莊鐵道大學軟件工程系 ");  90 System.out.println(" 學生學籍管理系統 2019 版 ");  91 System.out.println("***********************************************************");  92 System.out.println(" 學生學號: "+stud1);  93 System.out.println(" 學生姓名: "+stu[nm].name);  94 System.out.println(" 高等數學成績:"+stud2);  95 System.out.println(" 大學英語成績:"+stud3);  96 System.out.println(" 計算機網絡成績:"+stud4);  97 System.out.println(" 數據庫成績: "+stud5);  98 System.out.println(" 請輸入軟件工程成績: ");  99 System.out.println("***********************************************************"); 100 double stud6=in.nextDouble(); 101 stu[nm].softwarescore=stud6; 102 System.out.println("***********************************************************"); 103 System.out.println(" 石家莊鐵道大學軟件工程系 "); 104 System.out.println(" 學生學籍管理系統 2019 版 "); 105 System.out.println("***********************************************************"); 106 System.out.println(" 學生學號: "+stud1); 107 System.out.println(" 學生姓名: "+stu[nm].name); 108 System.out.println(" 高等數學成績:"+stud2); 109 System.out.println(" 大學英語成績:"+stud3); 110 System.out.println(" 計算機網絡成績:"+stud4); 111 System.out.println(" 數據庫成績: "+stud5); 112 System.out.println(" 軟件工程成績:"+stud6); 113 System.out.println(" 該學生成績已錄入完畢,是否提交(Y/N) "); 114 System.out.println("***********************************************************"); 115  
116 
117 } 118 
119 } 120 case 2: { 121 System.out.println("***********************************************************"); 122 System.out.println(" 石家莊鐵道大學軟件工程系 "); 123 System.out.println(" 學生學籍管理系統 2019 版 "); 124 System.out.println("***********************************************************"); 125 System.out.println(" 請輸入學生學號: "); 126 System.out.println("***********************************************************"); 127 int q1=in.nextInt(); 128 for(int i=0;i<5;i++) 129 {if (q1==stu[i].stunumber) 130 {flag=1; 131 nm=i;} 132 } 133 if(flag==0) 134 { System.out.println("學號不存在"); 135 
136 } 137 System.out.println("***********************************************************"); 138 System.out.println(" 石家莊鐵道大學軟件工程系 "); 139 System.out.println(" 學生學籍管理系統 2019 版 "); 140 System.out.println("***********************************************************"); 141 System.out.println(" 學生學號: "+q1); 142 System.out.println(" 學生姓名: "+stu[nm].name); 143 System.out.println(" 1高等數學成績:"+stu[nm].mathematicsscore); 144 System.out.println(" 2大學英語成績:"+stu[nm].englishiscore); 145 System.out.println(" 3計算機網絡成績:"+stu[nm].networkscore); 146 System.out.println(" 4數據庫成績: "+stu[nm]. databasescore ); 147 System.out.println(" 5軟件工程成績:"+stu[nm].softwarescore); 148 System.out.println("***********************************************************"); 149 int p1=in.nextInt(); 150 switch (p1) 151 {case 1:{double mn=in.nextDouble(); 152 stu[nm].mathematicsscore=mn;break;} 153 case 2:{double mn=in.nextDouble(); 154 stu[nm].englishiscore=mn;break;} 155 case 3:{double mn=in.nextDouble(); 156 stu[nm].networkscore=mn;break;} 157 case 4:{double mn=in.nextDouble(); 158 stu[nm].databasescore=mn;break;} 159 case 5:{double mn=in.nextDouble(); 160 stu[nm].softwarescore=mn;break;} 161 } 162 System.out.println("***********************************************************"); 163 System.out.println(" 石家莊鐵道大學軟件工程系 "); 164 System.out.println(" 學生學籍管理系統 2019 版 "); 165 System.out.println("***********************************************************"); 166 System.out.println(" 學生學號: "+q1); 167 System.out.println(" 學生姓名: "+stu[nm].name); 168 System.out.println(" 1高等數學成績:"+stu[nm].mathematicsscore); 169 System.out.println(" 2大學英語成績:"+stu[nm].englishiscore); 170 System.out.println(" 3計算機網絡成績:"+stu[nm].networkscore); 171 System.out.println(" 4數據庫成績: "+stu[nm]. databasescore ); 172 System.out.println(" 5軟件工程成績:"+stu[nm].softwarescore); 173 System.out.println(" 該學生成績已修改完畢,是否提交(Y/N) "); 174 System.out.println("***********************************************************"); 175 String stud7=in.next(); 176 if(stud7=="Y") 177 { 178 
179 } 180 } 181 
182 case 3:{ 183 int q1=in.nextInt(); 184 System.out.println("***********************************************************"); 185 System.out.println(" 石家莊鐵道大學軟件工程系 "); 186 System.out.println(" 學生學籍管理系統 2019 版 "); 187 System.out.println("***********************************************************"); 188 System.out.println(" 請輸入學生學號: "); 189 System.out.println("***********************************************************"); 190 for(int i=0;i<5;i++) 191 {if (q1==stu[i].stunumber) 192 {flag=1; 193 nm=i;} 194 } 195 if(flag==0) 196 { System.out.println("學號不存在"); 197 
198 } 199 double a1,a2,a3,a4,a5,a6; 200 if(stu[nm].mathematicsscore>=90) 201 a1=4; 202 else if(stu[nm].mathematicsscore>=85&&stu[nm].mathematicsscore<90) 203 a1=3.7; 204 else if(stu[nm].mathematicsscore>=82&&stu[nm].mathematicsscore<85) 205 a1=3.3; 206 else if(stu[nm].mathematicsscore>=78&&stu[nm].mathematicsscore<82) 207 a1=3.0; 208 else if(stu[nm].mathematicsscore>=75&&stu[nm].mathematicsscore<78) 209 a1=2.7; 210 else if(stu[nm].mathematicsscore>=72&&stu[nm].mathematicsscore<75) 211 a1=2.3; 212 else if(stu[nm].mathematicsscore>=68&&stu[nm].mathematicsscore<72) 213 a1=2.0; 214 else if(stu[nm].mathematicsscore>=66&&stu[nm].mathematicsscore<68) 215 a1=1.7; 216 else if(stu[nm].mathematicsscore>=64&&stu[nm].mathematicsscore<66) 217 a1=1.5; 218 else if(stu[nm].mathematicsscore>=60&&stu[nm].mathematicsscore<64) 219 a1=1.0; 220 else 
221 a1=0; 222 if(stu[nm].englishiscore>=90) 223 a2=4; 224 else if(stu[nm].englishiscore>=85&&stu[nm].englishiscore<90) 225 a2=3.7; 226 else if(stu[nm].englishiscore>=82&&stu[nm].englishiscore<85) 227 a2=3.3; 228 else if(stu[nm].englishiscore>=78&&stu[nm].englishiscore<82) 229 a2=3.0; 230 else if(stu[nm].englishiscore>=75&&stu[nm].englishiscore<78) 231 a2=2.7; 232 else if(stu[nm].englishiscore>=72&&stu[nm].englishiscore<75) 233 a2=2.3; 234 else if(stu[nm].englishiscore>=68&&stu[nm].englishiscore<72) 235 a2=2.0; 236 else if(stu[nm].englishiscore>=66&&stu[nm].englishiscore<68) 237 a2=1.7; 238 else if(stu[nm].englishiscore>=64&&stu[nm].englishiscore<66) 239 a2=1.5; 240 else if(stu[nm].englishiscore>=60&&stu[nm].englishiscore<64) 241 a2=1.0; 242 else 
243 a2=0; 244 
245 if(stu[nm].databasescore>=90) 246 a4=4; 247 else if(stu[nm].databasescore>=85&&stu[nm].databasescore<90) 248 a4=3.7; 249 else if(stu[nm].databasescore>=82&&stu[nm].databasescore<85) 250 a4=3.3; 251 else if(stu[nm].databasescore>=78&&stu[nm].databasescore<82) 252 a4=3.0; 253 else if(stu[nm].databasescore>=75&&stu[nm].databasescore<78) 254 a4=2.7; 255 else if(stu[nm].databasescore>=72&&stu[nm].databasescore<75) 256 a4=2.3; 257 else if(stu[nm].databasescore>=68&&stu[nm].databasescore<72) 258 a4=2.0; 259 else if(stu[nm].databasescore>=66&&stu[nm].databasescore<68) 260 a4=1.7; 261 else if(stu[nm].databasescore>=64&&stu[nm].databasescore<66) 262 a4=1.5; 263 else if(stu[nm].databasescore>=60&&stu[nm].databasescore<64) 264 a4=1.0; 265 else 
266 a4=0; 267 
268 if(stu[nm].softwarescore>=90) 269 a5=4; 270 else if(stu[nm].softwarescore>=85&&stu[nm].softwarescore<90) 271 a5=3.7; 272 else if(stu[nm].softwarescore>=82&&stu[nm].softwarescore<85) 273 a5=3.3; 274 else if(stu[nm].softwarescore>=78&&stu[nm].softwarescore<82) 275 a5=3.0; 276 else if(stu[nm].softwarescore>=75&&stu[nm].softwarescore<78) 277 a5=2.7; 278 else if(stu[nm].softwarescore>=72&&stu[nm].softwarescore<75) 279 a5=2.3; 280 else if(stu[nm].softwarescore>=68&&stu[nm].softwarescore<72) 281 a5=2.0; 282 else if(stu[nm].softwarescore>=66&&stu[nm].softwarescore<68) 283 a5=1.7; 284 else if(stu[nm].softwarescore>=64&&stu[nm].softwarescore<66) 285 a5=1.5; 286 else if(stu[nm].softwarescore>=60&&stu[nm].softwarescore<64) 287 a5=1.0; 288 else 
289 a5=0; 290 if(stu[nm].networkscore>=90) 291 a3=4; 292 else if(stu[nm].networkscore>=85&&stu[nm].networkscore<90) 293 a3=3.7; 294 else if(stu[nm].networkscore>=82&&stu[nm].networkscore<85) 295 a3=3.3; 296 else if(stu[nm].networkscore>=78&&stu[nm].networkscore<82) 297 a3=3.0; 298 else if(stu[nm].networkscore>=75&&stu[nm].networkscore<78) 299 a3=2.7; 300 else if(stu[nm].networkscore>=72&&stu[nm].networkscore<75) 301 a3=2.3; 302 else if(stu[nm].networkscore>=68&&stu[nm].networkscore<72) 303 a3=2.0; 304 else if(stu[nm].networkscore>=66&&stu[nm].networkscore<68) 305 a3=1.7; 306 else if(stu[nm].networkscore>=64&&stu[nm].networkscore<66) 307 a3=1.5; 308 else if(stu[nm].networkscore>=60&&stu[nm].networkscore<64) 309 a3=1.0; 310 else 
311 a3=0; 312 Double b=(a1*4+a2*3+a3*4+a4*3+a5*2)/16; 313 if(b>=2) { 314 
315 System.out.println("***********************************************************"); 316 System.out.println(" 石家莊鐵道大學軟件工程系 "); 317 System.out.println(" 學生學籍管理系統 2019 版 "); 318 System.out.println("***********************************************************"); 319 System.out.println(" 學生學號: "+q1); 320 System.out.println(" 學生姓名: "+stu[nm].name); 321 System.out.println(" 一、高等數學成績績點:"+a1); 322 System.out.println(" 二、大學英語成績績點:"+a2); 323 System.out.println(" 三、計算機網絡成績績點: "+a3 ); 324 System.out.println(" 四、數據庫成績績點: "+a4 ); 325 System.out.println(" 五、軟件工程成績績點:"+a5); 326 System.out.println(" 你的學分績點已達到畢業要求 "); 327 System.out.println("***********************************************************"); 328 } 329 else 
330 { 331 
332 System.out.println("***********************************************************"); 333 System.out.println(" 石家莊鐵道大學軟件工程系 "); 334 System.out.println(" 學生學籍管理系統 2019 版 "); 335 System.out.println("***********************************************************"); 336 System.out.println(" 學生學號: "+q1); 337 System.out.println(" 學生姓名: "+stu[nm].name); 338 System.out.println(" 一、高等數學成績績點:"+a1); 339 System.out.println(" 二、大學英語成績績點:"+a2); 340 System.out.println(" 三、計算機網絡成績績點: "+a3 ); 341 System.out.println(" 四、數據庫成績績點: "+a4 ); 342 System.out.println(" 五、軟件工程成績績點:"+a5); 343 System.out.println(" 你的學分績點不知足畢業要求 "); 344 System.out.println("***********************************************************"); 345 }break; 346 } 347 case 4:System.out.println("***********************************************************"); 348 System.out.println(" 謝謝使用石家莊鐵道大學軟件工程系學生學籍管理系統 2019 版 "); 349 System.out.println(" 製做人:鄭磊 "); 350 System.out.println("***********************************************************"); 351 default : System.out.println("輸入錯誤 "); 352 } 353 // TODO 自動生成的方法存根
354 
355 } 356 static void jie() { 357 
358 
359 System.out.println("***********************************************************"); 360 System.out.println(" 石家莊鐵道大學軟件工程系 "); 361 System.out.println(" 學生學籍管理系統 2019 版 "); 362 System.out.println("***********************************************************"); 363 System.out.println(" 一、 學生考試成績錄入 "); 364 System.out.println(" 二、 學生考試成績修改 "); 365 System.out.println(" 三、 計算學生成績績點 "); 366 System.out.println(" 四、退出學籍管理系統 "); 367 System.out.println("***********************************************************"); 368 
369 // TODO 自動生成的方法存根
370 
371 } 372 
373 } 374 
375 
376 
377 以上爲主函數,下面是定義的類 378 
379 package 做業; 380 
381 public class Scoreinformation{ 382 public int stunumber; 383 public String name; 384 public double mathematicsscore; 385 public double networkscore; 386 public double databasescore; 387 public double softwarescore; 388 public double englishiscore; 389 void setmathematicsscore() {mathematicsscore=100; 390 } void setnetworkscore() {networkscore=100; 391 } void setdatabasescore() { databasescore=100; 392 } void setsoftwarescore() {softwarescore=100; 393 } 394 void setenglishiscore() {englishiscore=100; 395 } 396 void getstunumber(int a) { 397 stunumber=a; 398 
399 } 400 void getname(String b) { 401 name=b; 402 
403 } 404 void getmathematicsscore(double c) { 405 mathematicsscore=c; 406 } 407 void getnetworkscore(double d) { 408 networkscore=d; 409 } 410 void getdatabasescore(double e) { 411 databasescore=e; 412 } 413 void getsoftwarescore(double f) { 414 softwarescore=f; 415 } 416 void getenglishiscore(double g) { 417 softwarescore=g; 418 } 419 public 
420 Scoreinformation(int stunumber,String name,double mathematicsscore,double englishiscore,double networkscore,double databasescore,double softwarescore) 421 { 422 this.stunumber=stunumber; 423 this.name=name; 424 this.mathematicsscore=mathematicsscore; 425 this.englishiscore=englishiscore; 426 this.networkscore=networkscore; 427 this.databasescore=databasescore; 428 this.softwarescore=softwarescore; 429 } 430 }

 

 第一個功能是輸入學號進行搜索學生項目,並對其進行成績修改css

提示用戶輸入高等數學成績,用戶輸入正確的數字;則提示用戶輸入大學
英語成績,依次類推,提示用戶錄入計算機網絡、數據庫、軟件工程成績java

,而後會提示,是否保存數據庫

若是輸入錯誤的數字,則會提示,數字錯誤編程

輸入完成後,就會顯示全部的成績小程序

 

 

 

第二個功能是對成績進行修改網絡

 

 

如上圖便可得。編程語言

最後就是計算學分績點的功能函數

 

 根據輸入的成績自動計算是否可以畢業。this

再最後就是能夠按4,退出系統。spa

 

 

心得:做爲本學期,第一個本身開發的小程序,仍是很開心的,況且仍是一個新接觸到的語言。在此次編程過程當中,我逐漸瞭解到了JAVA的一些須要瞭解到的事情。一些基本的語言技巧等等。這些給我帶來了不少成就感,離開老師,咱們也能夠自學到編程語言,雖然,此次開發的並不算什麼特別難的程序,但開學,自學到這種程度,我以爲仍是挺滿意的。

相關文章
相關標籤/搜索