Javaのジョブ - 学生情報管理システム

// 20183761宇明司
ScoreInformation.java
輸入java.lang.Object上位。

クラスScoreInformation {
    プライベート文字列stunumber。
    プライベート文字列名;
    プライベートダブルmathematicsscore。
    プライベートダブルenglishscore。
    プライベートダブルnetworkscore。
    プライベートダブルdatabasescore。
    プライベートダブルsoftwarescore。
    
    パブリックScoreInformation(){
        this.stunumber = stunumber。
        this.name =名前;
        this.mathematicsscore = mathematicsscore。
        this.englishscore = englishscore。
        this.networkscore = networkscore。
        this.databasescore = databasescore。
        this.softwarescore = softwarescore。
    }
    





    // stunumber的ゲッターセッター
    公共ボイドsetStunumber(文字列stunumber){
        this.stunumber = stunumber。
    }
    パブリック文字列getStunumber(){
        戻りstunumber。
    }
    
    //名前的ゲッターセッター
    公共ボイドのsetName(文字列名){
        this.name =名。
    }
    パブリック文字列のgetName(){
        戻り名。
    }
    
    // mathematicsscore的ゲッターセッター
    公共ボイドsetMathematicsscore(ダブルmathematicsscore){
        this.mathematicsscore = mathematicsscore。
    }
    公共ダブルgetMathematicsscore(){
        戻りmathematicsscore。
    }
    
    // englishscore的ゲッターセッター
    公共ボイドsetEnglishscore(ダブルenglishscore){
        this.englishscore = englishscore。
    }
    公共ダブルgetEnglishscore(){
        戻りenglishscore。
    }
    
    // networkscore的ゲッターセッター
    公共ボイドsetNetworkscore(ダブルnetworkscore){
        this.networkscore = networkscore。
    }
    公共ダブルgetNetworkscore(){
        戻りnetworkscore。
    }
    
    // databasescore的ゲッターセッター
    公共ボイドsetDatabasescore(ダブルdatabasescore){
        this.databasescore = databasescore。
    }
    公共ダブルgetDatabasescore(){
        databasescoreを返します。
    }
    
    // softscore的ゲッターセッター
    公共ボイドsetSoftwarescore(ダブルsoftwarescore){
        this.softwarescore = softwarescore。
    }
    公共ダブルgetSoftwarescore(){
        softwarescore返します。
    }
    
    
    

}

ScoreManagement.java

輸入java.io.BufferedReader;
インポートにjava.io.IOException;
輸入java.io.InputStreamReader。
インポートjava.util.Scanner;

パブリッククラスScoreManagement {
    

    ScoreInformation [] =新しいScoreInformation [10]。
    int型の合計= 0;
    ボイドsetManager(INT n)はIOExceptionを//输入学生信息スロー
    {
        BufferedReaderのリーダー=新しいBufferedReaderの(新たにInputStreamReader(System.in))を、
        文字列str = NULL;
        (; iがN <I ++はiが0 = INT)のために
        {
            [I] =新しいScoreInformation()。//定义对象、开辟空间
            列stunumber = reader.readLine()。
            [I] .setStunumber(stunumber)。
            文字列名= reader.readLine()。
            [I] .setName(名);
            二重mathematicsscore = Double.parseDouble(STR)。
            [I] .setMathematicsscore(mathematicsscore)。
            二重englishscore = Double.parseDouble(STR)。
            [I] .setEnglishscore(englishscore)。
            二重networkscore = Double.parseDouble(STR)。
            [I] .setNetworkscore(networkscore)。
            二重databasescore = Double.parseDouble(STR)。
            [I] .setDatabasescore(databasescore)。
            二重softwarescore = Double.parseDouble(STR)。
            [I] .setSoftwarescore(softwarescore)。
        }
        this.sum = N。
    }
    addStudentボイド(stunumber文字列、列名、int型の年齢、ダブルmathematicsscore、ダブルenglishscore、ダブルnetworkscore、
            ダブルdatabasescore、ダブルsoftwarescore)がスローにIOException
    {     
        System.out.printlnは(「************* **********************************************「);
        システム.out.println(「ソフトウェアエンジニアリングの学生管理システムの石家荘鉄道研究所バージョン2019」);
        System.out.printlnは(「生徒のテストの点数エントリ」);
        System.out.printlnは(「******** ************************************************** * ");
        System.out.printlnはは("学生番号を入力してください:「);
                                                                      //新しい学生情報追加
        =「」文字列strを、
        T = 0 INT;
        のために(; Iは、SUMを<; I = 0 int型Iが++)
            IF(A [I] .getStunumber()に等しい(stunumber)。)
                {
                  
                 Tの= 1;
                }
        IF(T == 0)
        {
            [ SUM] ScoreInformation新しい新=();                      
            [SUM] .setStunumber(stunumber);
            [SUM] .setName(名);
            System.out.printlnは( "学生の数:" + stunumber);
            System.out.printlnは( "学生名:" +名);
            System.out.printlnは( "高い数学の成績を入力してください:");
            [SUM] .setMathematicsscore(mathematicsscore);
            System.out.printlnは( "高い数学の成績:" + mathematicsscore) ;
            System.out.printlnは( "大学の英語のスコアを入力してください:「);
            [SUM] .setEnglishscore(englishscore);
            System.out.printlnは( "大学英語スコア:" + englishscore);
            System.out.printlnは( "コンピュータネットワークのパフォーマンスを入力してください:");
            [SUM] .setNetworkscore(networkscore );
            のSystem.out.println( "コンピュータネットワークの結果:" + networkscore)
            のSystem.out.println( "データベースの結果を入力してください");
            [SUM] .setDatabasescore(databasescore)
            のSystem.out.println( "データベースのパフォーマンス: "+ databasescore);
            SUM + = 1;
            System.out.printlnは("成功を追加");!
            するSystem.out.println("生徒の成績の完了は(Y- / Nを提出するかどうか、入力された)「);
            CHAR CH;
            ;文字列STR1
            新しい新=(System.in)スキャナスキャナ。
            STR1 = In.next()。
            CH = str1.charAt(0)。
            (CH == 'Y' || CH == 'y')の場合
            {
              this.addStudent(STR1、STR1、T、softwarescore、softwarescore、softwarescore、softwarescore、softwarescore)。
            }
            もし、(CH == 'N' || CH == 'N')
            {
              this.menu()。
            }
            
        }
        他
            のSystem.out.println( "学号已存在")。
        System.out.println( "******************************************* **************** ");    
    }
    無効updateStudent(文字列のstunumber、文字列名、int型の年齢、ダブルmathematicsscore、ダブルenglishscore、ダブルnetworkscore、
            ダブルdatabasescore、
    {  
        //学生番号、学生情報に従って修正
        するSystem.out.println(「********************************** ************************************************************「);
        System.out.printlnは(」ソフトウェア工学の学生管理システム2019年版「)の石家荘鉄道研究所。
        System.out.println( "学生のテストの点数変更インタフェース");
        System.out.printlnは(「**************************** ******************************* ");
        System.out.printlnはは("学生番号を入力してください:「);

        0 = I値int;
            IF([I] .getStunumber()に等しい(stunumber))
            {  
                するSystem.out.println( "生徒番号:");
                のSystem.out.println( "生徒名:");
                システム.out.println( "1、より高い数学:「+ [I] .getMathematicsscore())。
                System.out.println( "2、達成における" + A [I] .getEnglishscore());
                のSystem.out.println( "3、コンピュータネットワーク性能:" + [I] .getNetworkscore ())。
                System.out.println( "4、データベース性能:" A + [I] .getDatabasescore());
                のSystem.out.println( "5、ソフトウェアエンジニアリングの結果:" A + [I] .getSoftwarescore());
            }
            System.out.println( "変性スコアを入力してください");
            B = in.nextInt();
            スイッチ(B)
            {
              ケース1:[I] .setMathematicsscore(mathematicsscore); BREAK;
              ケース2:[I] .setEnglishscore(englishscore); BREAK;
              ケース3:[I] .setNetworkscore(networkscore); BREAK;
              ケース4:[I] .setDatabasescore(databasescore)。ブレーク;
              5ケース:[I] .setSoftwarescore(softwarescore); BREAK;
            }
            のSystem.out.printlnは( "生徒グレード(Y / N)を提出するかどうかを、修飾を有する");
            CHAR CH2と、
            文字列STR2を、
            スキャナの新しい新しい= Inをスキャナ(System.in);
            STR2 = In.next();
            CH 2 = str2.charAt(0);
            IF(CH2 == 'Y' || CH2 == 'Y')
            {
              this.addStudent();
            }
            IF (CH2 == 'N' || CH2 == 'N-')
            {
              this.menu();
            }
        のSystem.out.println(「******************* ****************************************「);
    }

    
    公共ボイドメニュー(){
        int型;
        =新新(System.in)でスキャナスキャナ;
        System.out.printlnは(「**************************************************************** *********************************************************** ");
        System.out.printlnは("ソフトウェア工学「)石家荘鉄道研究所、
        システム.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は(「*************************** ******************************** ");
        のSystem.out.println("「);
        するSystem.out.println ( "(〜1.4)を選択してください。");
        A = in.nextInt();
        ながら(<A 1 ||> 4)
        {
          System.out.printの( "レンジの入力のうち、再入力してください") ;
          A = in.nextInt();
        }
        スイッチ(A)
        {
          ケース1:this.addStudent(); BREAK;
          ケース2:this.updateStudent(); BREAK;
          ケース3:this.cal(); BREAK。
          ケース0:でSystem.exit(0);破ります;
        }       
      }
        
}        

Main.java


インポートjava.util.Scanner;

パブリッククラスメイン{
      パブリック静的無効メイン(文字列[] args)
      {   
          ScoreInformationのSTU =新しいScoreInformation()。
        (; iが2 <I ++はiが0 = INT)のために
        {
          [I] =新しいScoreInformation()。
        }
        stu.menu()。
      }
}



おすすめ

転載: www.cnblogs.com/Aming-/p/11515664.html