Giter Club home page Giter Club logo

9876543211 / scoresummary Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 4 KB

以下の4メソッドを持つExamSummaryクラスを作成せよ。 /** * 学籍番号,科目,得点を登録する */ void register(String 学籍番号 , Subject 科目 , int 得点); /** * 引数で指定された学籍番号・科目の得点を返す * @return 得点 */ int getScore(String 学籍番号, Subject 科目); /** * 引数で指定された科目の最高得点の学籍番号を返す * @return 学籍番号のリスト */ List<String> getTopScoreIdsBySubject(Subject 科目); /** * 全科目の平均得点の高い順に学籍番号を返す * @return 学籍番号のリスト */ List<String> getIdsByAverage(); なおSubjectは以下のような定義でよい。 enum Subject { MATH, SCIENCE, ENGLISH } 使用例) ExamSummary es = new ExamSummary(); es.register ("00kc001",Subject.MATH , 85); es.register ("00kc001",Subject.SCIENCE , 75); es.register ("00kc001",Subject.ENGLISH , 65); es.register ("00kc002",Subject.MATH , 60); es.register ("00kc002",Subject.SCIENCE , 80); es.register ("00kc002",Subject.ENGLISH , 70); es.register ("00kc003",Subject.MATH , 90); es.register ("00kc003",Subject.SCIENCE , 55); es.register ("00kc003",Subject.ENGLISH , 65); int score = es.getScore("00kc002",Subject.MATH); List<String> topScoreIds = es.getTopScoreIdsBySubject(Subject.ENGLISH); List<String> ids = es.getIdsByAverage();

Java 100.00%

scoresummary's Introduction

ScoreSummary

以下の4メソッドを持つExamSummaryクラスを作成せよ。

/** * 学籍番号,科目,得点を登録する */
void register(String 学籍番号 , Subject 科目 , int 得点);

/** * 引数で指定された学籍番号・科目の得点を返す

  • @return 得点 */
    int getScore(String 学籍番号, Subject 科目);

/** * 引数で指定された科目の最高得点の学籍番号を返す

  • @return 学籍番号のリスト /
    List getTopScoreIdsBySubject(Subject 科目);
    /
    *
  • 全科目の平均得点の高い順に学籍番号を返す
  • @return 学籍番号のリスト */
    List<String> getIdsByAverage();
    なおSubjectは以下のような定義でよい。
    enum Subject { MATH, SCIENCE, ENGLISH }
    使用例)
    ExamSummary es = new ExamSummary();
    es.register ("00kc001",Subject.MATH , 85);
    es.register ("00kc001",Subject.SCIENCE , 75);
    es.register ("00kc001",Subject.ENGLISH , 65);
    es.register ("00kc002",Subject.MATH , 60);
    es.register ("00kc002",Subject.SCIENCE , 80);
    es.register ("00kc002",Subject.ENGLISH , 70);
    es.register ("00kc003",Subject.MATH , 90);
    es.register ("00kc003",Subject.SCIENCE , 55);
    es.register ("00kc003",Subject.ENGLISH , 65);
    int score = es.getScore("00kc002",Subject.MATH);
    List topScoreIds = es.getTopScoreIdsBySubject(Subject.ENGLISH);
    List ids = es.getIdsByAverage();

scoresummary's People

Contributors

9876543211 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.