public class Student {
private String id; //学号
private String name; //姓名
private String gender; //性别
private int age; //年龄
private String classroom; //班级
private double internet; //计算机网络基础课程成绩
private double java; //嵌入式面向对象编程(Java)课程成绩
private double mysql; //MySQL数据库课程成绩
private double inventor; //面向对象计算思维APP Inventor课程成绩
//求课程的总成绩
public void ShowGrade() {
double grade = getInternet() + getJava() + getMysql() + getInventor();
System.out.println("四门功课的总成绩:" + grade);
System.out.println("平均成绩:" + grade / 4);
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getClassroom() {
return classroom;
}
public void setClassroom(String classroom) {
this.classroom = classroom;
}
public double getInternet() {
return internet;
}
public void setInternet(double internet) {
this.internet = internet;
}
public double getJava() {
return java;
}
public void setJava(double java) {
this.java = java;
}
public double getMysql() {
return mysql;
}
public void setMysql(double mysql) {
this.mysql = mysql;
}
public double getInventor() {
return inventor;
}
public void setInventor(double inventor) {
this.inventor = inventor;
}
}
温馨提示:答案为网友推荐,仅供参考