public class Grade {
Private double Chinese; Language achievement
private double math; Math Scores
Private double 中文版; English score
Public Grade (double Chinese, double math, double 中文版)//constructor
{
This.chinese= Chinese;
This.math = Math;
This.english = 中文版;
}
Public double Total () {//Calculated total
Return Chinese + math + 中文版;
}
public void Printtotal () {//Output total
System.out.println (Total ());
}
Public double average () {//Calculate average
return Total ()/3;
}
public void Printaverage () {//Output average
System.out.println (average ());
}
Public double Getchinese () {//Get language score
return Chinese;
}
public void Setchinese (double Chinese) {
This.chinese = Chinese;
}
Public double Getmath () {//Get math Score
return math;
}
public void Setmath (double math) {
This.math = Math;
}
Public double Getenglish () {//Get English Score
return 中文版;
}
public void Setenglish (double 中文版) {
This.english = 中文版;
}
}
Class Student {
String name; Student Name
Grade Grade; Results
Public Student (String name, Grade Grade) {
THIS.name = name;
This.grade = grade;
}
public static void Main (string[] args) {//main program call
Student s = new Student ("Cici", New Grade (89, 78, 98));
S.grade.printaverage ();
S.grade.printtotal ();
}
}
Design 10 students score information, the students have 3 courses, the calculation of the students total peace and evenly. Sort output