我自己注释了类定义,在每个方法的空白区域内添加方法定义,用点表示,就像我前面注释所。
{ private String name; // the student’s full name
private String id; // the student ID
private int credits; // the amount of credits for study taken so far
// Create a new student with a given name and ID number.
public Student (String fullName, String studentID)
{ name = fullName;
id = studentID;
credits = 0; }
// Return the full name of this student.
…………………………………………………..
// Set a new name for this student.
…………………………………………………..
// Return the student ID of this student.
………………………………………………….
// Add some credit points to the student’s accumulated credits.
………………………………………………………………………
/* Check the number of credit points this student has accumulated.
* If it is less than 132, then print “Not yet graduated”, otherwise print “Graduated”.
*/
for (i=0; i<2; i++) {
System.out.print("Enter Marks of Subject"+(i+1)+":");
marks[i] = scanner.nextInt();
total = total + marks[i]; }
scanner.close();
……………………………………………………………………
// Print the student’s name and ID number to the output terminal.
………………………………………………………
```……………..