Advertisement

BUPT HUSTOJ 1046

阅读量:

敬请持续关注,以获取最新动态!

问题 A: 学生列表类

      • 问题说明
        • 数据输入
        • 结果输出
    • 程序实现

题目描述

设计一个StudentList类,用于保存Student对象。其属性包括:
1)Student[] list; // 该数组用于存储学生对象
2)int total; // 表示学生总数

该类应具备以下方法:
1)StudentList(int length) // 参数length表示数组的长度
2)boolean add(Student stu) // 将stu添加到数组中,若操作成功则返回true,否则返回false
3)boolean remove(String number) // 删除学号为number的学生,若删除成功则返回true,否则返回false
4)boolean updateItem(String number, int math, int english, int science) // 更新指定学号学生的三门课程成绩,若操作成功则返回true,否则返回false
5)boolean isEmpty() // 判断数组是否为空,若为空则返回true,否则返回false
6)int getTotal() // 返回当前学生总数
7)St

全部评论 (0)

还没有任何评论哟~