当前位置:   article > 正文

键盘录入学生信息按照总分排序后输出在控制台_输入三位同学的成绩,按照总分大小排序输出

输入三位同学的成绩,按照总分大小排序输出

键盘录入学生信息按照总分排序后输出在控制台

​ 需求:键盘录入3个学生信息(姓名,语文成绩,数学成绩,英语成绩),按照总分从高到低输出到控制台。

Student类
public class Student implements Comparable {
   
    private String name;
    private int chinesePerformance;
    private int mathPerformance;
    private int englishResults;
    private int zongfen;

    public int getZongfen() {
   
        return zongfen;
    }

    public void setZongfen(int zongfen) {
   
        this.zongfen = zongfen;
    }

    public Student() {
   
    }


    public Student(String name, int chinesePerformance, int mathPerformance, int englishResults, int zongfen) {
   
        this.name = name;
        this.chinesePerformance = chinesePerformance;
        this.mathPerformance = mathPerformance;
        this.englishResults = englishResults;
        this.zongfen = zongfen;
    }

    public String getName() {
   
        return name;
    }

    public void setName(String name) {
   
        
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/408447
推荐阅读
相关标签
  

闽ICP备14008679号