用JAVA定义?

发布网友 发布时间:2022-04-23 09:42

我来回答

1个回答

热心网友 时间:2023-09-15 16:28

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;
}
}

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com