I NEED HELP ASAP! WILL reward full poinsts Complete the following program so tha
ID: 3772695 • Letter: I
Question
I NEED HELP ASAP! WILL reward full poinsts
Complete the following program so that it prints the name of the student with the minimal grade and her grade (laura Getz 72).
Add code to MINSTUDENT,Student, Tostring and CompareTo
public class Students {
public static void main(String[] args)
{
Student [] list = new Student[6];
list[0] = new Student ("John Smith", 90);
list[1] = new Student ("Sarah Barners", 90);
list[2] = new Student ("Mark Riley", 80);
list[3] = new Student ("Laura Getz", 72);
list[4] = new Student ("Larry Smith", 95);
list[5] = new Student ("Frank Pheleps", 75);
System.out.println (minStudent(list));
}
public class student minStudent (comparable []list )
{
}
public class student implements Comparable
{
public string name;
public int grade;
public Student (string stname,int stgrade)
{
}
public String toString()
{
}
public intCompareTo (object x)
{
}
Explanation / Answer
It may helps you..
public class student_grade{
public static void main(String hy[]){
Student1[] list=new Student1[6];
list[0] = new Student1 ("John Smith", 90);
list[1] = new Student1 ("Sarah Barners", 90);
list[2] = new Student1 ("Mark Riley", 80);
list[3] = new Student1 ("Laura Getz", 72);
list[4] = new Student1 ("Larry Smith", 95);
list[5] = new Student1 ("Frank Pheleps", 75);
System.out.println (minStudent(list));
}
private static char[] minStudent(Student1[] list) {
for(int i=0;i<list.length;i++){
new Student1().compareTo(list);
}
return null;
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.