希望在明天早上之前给我,谢谢了!!是JAVA程序哦!!!

来源:百度知道 编辑:UC知道 时间:2024/05/04 04:38:26
我一共也就三十分全赏给你了,只求程序
There is a class Student,the Student class has the fields name(String),birthYear(int),graduate
(boolean),no(int),a method toString (return the student no and name.)
1 write a method displayStudent(),that will received a collection of students as a parameter,and will be use Comparator to sort the items in the collection by name.(p719 lecture 9(29))
2 method storeStudents(),that will be receive a collection of students as a parameter,the method must open a text file and store the data to the text file,you must use toString() methods.and this method must return boolean,true is store ok,else fail.
3 method printGradutedStudents(),received a collection of students as a parameter,and the method is print Gradute students,and then use the displayStudent() to sort the gradute students .

4. Method locateTheStudent(),received a collection and a student no as parameters,if find the no student in the collection,then the method will return tr

我很不想写,原因在于你哪个"赏"字
但是我还是写了, 告诉你这么简单的题目,你都 ... ... 还好意思说"赏"

实体类:
package com.student.ziguopu.entity;

public class Student implements Comparable{
private String name;
private int birthYear;
private boolean graduate;
private int no;
public Student() {
}
public Student(String name, int birthYear, boolean graduate, int no) {
this.name = name;
this.birthYear = birthYear;
this.graduate = graduate;
this.no = no;
}
public int getBirthYear() {
return birthYear;
}
public void setBirthYear(int birthYear) {
this.birthYear = birthYear;
}
public boolean isGraduate() {
return graduate;
}
public void setGraduate(boolean graduate) {
this.graduate = graduate;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
pu