文章目录
一、功能需求
case 10:添加学生
case 11:查找一个学生
case 12:根据编号更新学生基本信息
case 13:根据编号删除学生
case 14:根据编号录入成绩
case 99:退出系统
二、代码框架
一共有三个文件:
1、Student.java(学生类) //学生的基本信息
2、StudentManage.java(学生管理类) //用于对学生集合操作
3、StudentMain.java(主程序)
三、代码
下面为具体的代码:
1.学生类 Student.java
package com.studentlist.test;
/**
* 学生类
*/
public class Student {
private int number;
private String name;
private int age;
private int python;
private int java;
private int linux;
private int sql;
private int sum;
private double avg;
Student(int number ,String name,int age){
this.number=number;
this.name=name;
this.age=age;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public int getPython() {
return python;
}
public void setPython(int python) {
this.python = python;
}
public int getJava() {
return java;
}
public void setJava(int java) {
this.java = java;
}
public int getLinux() {
return linux;
}
public void setLinux(int linux) {
this.linux = linux;
}
public int getSql() {
return sql;
}
public void setSql(int sql) {
this.sql = sql;
}
public int getSum() {
return sum;
}
public void setSum() {
this.sum = this.python+this.java+this.linux+this.sql;
}
public double getAvg() {
return avg;
}
public void setAvg() {
this.avg = (double)this.sum/4;
}
public String