java.1

student.java

パッケージスコア;
パブリッククラス学生{
 プライベート文字列stunumber。
 プライベート文字列名;
 プライベートダブルmathematicsscore。
 プライベートダブルenglishiscore。
 プライベートダブルnetworkscore。
 プライベートダブルdatabasescore。
 プライベートダブルsoftwarescore。
 ます。public void setStudent()
 {
  学生B =新しい学生();
  b.setNumber( "ハオzijia");
  b.setNumber( "20183684");
  b.setMscore(90)。
  b.setEscore(90)。
  b.setNscore(90)。
  b.setDscore(90)。
  b.setSscore(90)。
 }
 公共ボイドgetStudent()
 {
  学生B =新しい学生()。
  System.out.println( "学生学号:");
  b.getNumber();
  System.out.println( "学生名:");
  b.getName();
  System.out.printlnは( "1つの高い数学の成績:.");
  B.getMscore();
  System.out.printlnは(「2。英語結果: ");
  b.getEscore();
  のSystem.out.println("コンピュータネットワーク3つの結果: ");.
  b.getNscore();
  System.out.printlnは("データベース4件の結果:「);.
  b.getDscore();
  のSystem.out.println( "ソフトウェアエンジニアリングの達成5 :.。");
  b.getSscore();
 }
 公共ボイドsetNumber(列番号){
  stunumber =数;
 }
 公共ボイドのsetName(文字列名){
  名前= this.name;
 }
 公共ボイドsetMscore(ダブルmscore){
  mathematicsscore = mscore。
 }
 公共ボイドsetEscore(ダブルスコア){
  englishiscore =スコア。
 }
 公共ボイドsetNscore(ダブルnscore){
  networkscore = nscore。
 }
 公共ボイドsetDscore(ダブルdscore){
  databasescore = dscore。
 }
 公共ボイドsetSscore(ダブルsscore){
  softwarescore = sscore。
 }
 パブリック文字列はgetNumber(){
  戻りstunumber。
 }
 パブリック文字列のgetName(){
  戻り名。
 }
 公共ダブルgetMscore(){
  戻りmathematicsscore。
 }
 公共ダブルgetEscore(){
  戻りenglishiscore。
 }
 公共ダブルgetNscore(){
  戻りnetworkscore。
 }
 公共ダブルgetDscore(){
  databasescoreを返します。
 }
 公共ダブルgetSscore(){
  softwarescore返します。
 }
 パブリック静的無効メイン(文字列[] args){
  学生myScoreInformation =新しい学生()。
  myScoreInformation.setName( "Haozijia");
  myScoreInformation.setNumber( "20183684");
  myScoreInformation.setMscore(90)。
  myScoreInformation.setEscore(90)。
  myScoreInformation.setNscore(90)。
  myScoreInformation.setDscore(90)。
  myScoreInformation.setSscore(90)。
  myScoreInformation.getName();
  myScoreInformation.getNumber();
  myScoreInformation.getMscore();
  myScoreInformation.getEscore();
  myScoreInformation.getNscore();
  myScoreInformation.getDscore();
  myScoreInformation.getSscore();
 }
}

 

ScoreManager.java

;パッケージスコア
; java.util.ArrayListの輸入
、インポートjava.util.Scanner
パブリッククラスScoreManger {
 ;静的生徒S [] =新しい新しい学生[4]
 静的スキャナスキャナのスキャンが新しい新=(System.in);
 公共ボイドsetStudent()
 {
  学生学生新しい新B =();
  b.setNumber( "ハオzijia");
  b.setNumber( "20183684");
  b.setMscore(90);
  b.setEscore(90);
  b.setNscore(90);
  B .setDscore(90);
  b.setSscore(90);
 }
 公共ボイドlurushow1()
 {
  System.out.printlnは(「************************************************************ ************「);
  System.out.printlnは(」ソフトウェアエンジニアリングの学生管理システムの石家荘鉄道研究所バージョン2019「);
  System.out.printlnは(」生徒のテストの点数エントリー「) ;
  System.out.println( "***********************************");
  System.out.println( "请输入学生学号:");
  System.out.println( "***********************************");
 }
 パブリック静的ボイドlurustudent(のArrayList <学生> ARRY){
  
  文字列stunumber。
  (TRUE){一方
   ( "请输入学生学号:")するSystem.out.println。
   stunumber = scan.nextLine()。
   ブール・フラグ= FALSE。
   以下のために(; iはarry.size()<; I = 0 int型私は++){
    生徒S = arry.get(I)。
    (s.getNumber()に等しい(stunumber)){もし  
     フラグ= TRUE。   
     ブレーク;
    }
   (フラグ){場合
    のSystem.out.println( "***********************************") ;
    System.out.printlnは(」
    System.out.println( "生徒のテストの点数エントリ");
    System.out.printlnは(「**************************************************************** ****** ");
    s.getStudent();
    のSystem.out.println(" **************************** ******* ");
   }他{
    BREAK;
   }
  }
   }
 }
 公共ボイドzhushow()
 {
  System.out.printlnは(" ************************************************** ***************** ");
  System.out.printlnは("ソフトウェア・エンジニアリング、石家荘鉄道研究所");
  System.out.printlnは(" S学生管理システムバージョン2019 ");
  System.out.printlnは(" ***********************************「);
  システム。 out.printlnを( "1、学生のテストの点数エントリ");
  のSystem.out.println( "2、生徒のテストの点数変更");
  のSystem.out.println( "3は、生徒の成績グレードポイントを計算します")。
  System.out.println( "4は、学校管理システムを終了しました");
  System.out.println( "***********************************");
 }
 公共の静的な無効changestudent (ArrayListの<学生> ARRY){
  String型stunumber1;
   System.out.printlnは( "あなたは結果を変更したい学生を選択してください:");
    System.out.printlnは(「************** *********************「);
    System.out.printlnは(」学生のテストの点数変更インタフェース「);
    System.out.printlnはは(」学生が学ぶ入力してください。米国特許");
    のSystem.out.println(" ***********************************「);
    stunumber1 scan.next =();
   のために(;私は<5; I = 0 int型。私は++){
    IF(stunumber1.equals(S [I] .getNumber())){
     するSystem.out.println(「***** ***********************************************************「);
     System.out.printlnは(」ソフトウェア・エンジニアリング、石家荘鉄道研究所の学生管理システム2019年版「);
     のSystem.out。println(「生徒のテストの点数エントリ」);
     System.out.println( "***********************************");
     S [i]は.getStudent()。
     System.out.println( "该学生成绩已修改成功");
    }
    他{
      するSystem.out.println( "该学生不存在")。
     }
   }
  }
   パブリック静的ダブルjidian {(Aダブル)
    場合(A> = 90)4.0を返します。
    IF((A> = 85)&&(<= 89.9))3.7を返します。
    IF((A> = 82)&&(<= 84.9))3.3を返します。
    IF((A> = 78)&&(<= 81.9))3.0を返します。
    IF((A> = 75)&&(<= 77.9))2.7を返します。
    IF((A> = 72)&&(<= 74.9))2.3を返します。
    ((A> = 68)&&(<71.9))であれば2.0を返します。
    IF((A> = 66)&&(<= 67.9))1.7を返します。
    IF((A> = 64)&&(<= 65.9))1.5を返します。
    IF((A> = 60)&&(<= 63.9))1.0を返します。
    IF(<60)戻り0;
    返します。
   }
 パブリック静的無効メイン(文字列[] args)
 {
  のArrayList <学生> ARRY =新規のArrayList <>();
      学生S [] =新しい生徒[4]。
      S [0] .setStudent()。
      S [1] .setStudent()。
      S [2] .setStudent()。
      S [3] .setStudent()。
      S [4] .setStudent()。
      ScoreMangerのA =新しいScoreManger();
      a.zhushow();
      System.out.println( "输入选择的序号を请");
      ストリングstufunction = scan.nextLine()。
      スイッチ(stufunction){
      場合"1":
       a.lurushow1();
       lurustudent(ARRY)。
       ブレーク;
      場合"2":
       changestudent(ARRY)。
       BREAK;
      ケース:」3" 。
       ダブルC1、C2、C3、C4、C5、D;
       (; Iは<5 I ++はI = 0をint型。)のために
       {
        C1 = jidian(S [I] .getMscore());
        C2 = jidian(S [I] .getEscore());
        C3 jidian =(S [I] .getNscore());
        ; jidian C4 =(S [I] .getDscore())
        C5 = jidian(S [I] .getSscore ());
        D =(C1 + C2 + C3 + C4 + C5)/ 5;
       
       のSystem.out.println(「************************************************************ ************「);
    System.out.printlnは(」ソフトウェアエンジニアリングの学生管理システムの石家荘鉄道研究所バージョン2019「);
    System.out.printlnは(」グレードポイント平均計算のための学生のテストの点数インターフェース");
    System.out.printlnは(" ***********************************「);
    システム.out.println( "学生ID:");
    のSystem.out.println(S [I] .getNumber())。
    System.out.println( "名:");
    System.out.println(S [I] .getName());
    のSystem.out.println( "高等数学1 GPA :.。");
    のSystem.out.println(C1)
    のSystem.out.println( "グレードポイント2.大学英語スコア: ");
    System.out.printlnは(C2);
    System.out.printlnは("コンピュータネットワークの性能グレードポイント3 :.「);
    System.out.printlnは(C3)
    のSystem.out .println( "平均4つのデータベースグレードグレード点:.");
    のSystem.out.println(C4)
    のSystem.out.println( "ソフトウェアエンジニアリング達成等級ポイント5 :.");
    のSystem.out.println(C5)。
    System.out.println( "あなたのGPA:");
    System.out.printlnは(D);
    IF(D> = 2)
     のSystem.out.println(「あなたのグレードポイントに達した卒業要件! 「);
    他
     のSystem.out.println(」あなたのグレードポイントが卒業の要件を満たしていない!「);
    System.out.printlnは(」*********************************** ");
    System.out.println( "かメイン画面(Y / N)に戻る");
       }
       BREAK、
      ケース"4" 。:
      デフォルト:
       のSystem.out.println(" ************** *********************「);
       System.out.printlnは(」ソフトウェアエンジニアリングの学生管理システムのバージョン2019の石家荘鉄道研究所「)の使用いただき、ありがとうございます;
       システム。 out.printlnを( "プロデューサー:ハオZaijia");
       System.out.printlnは(「******************************* ****「);
       にSystem.exit(0);
       BREAK;
      }
     }
 }

おすすめ

転載: www.cnblogs.com/123-haozijia/p/11514755.html