Question

In Java programming language Please write code for the 6 methods below: Assume that Student class...

In Java programming language

Please write code for the 6 methods below:

Assume that Student class has name, age, gpa, and major, constructor to initialize all data, method toString() to return string reresentation of student objects, getter methods to get age, major, and gpa, setter method to set age to given input, and method isHonors that returns boolean value true for honors students and false otherwise.

1) Write a method that accepts an array of student objects, and n, the number of students stored in this array and returns ArrayList of honors students.

public ArrayList honorsStudents(Student[] list, int n)

{

}

2) Write a method that accepts an array of student objects, and n, the number of students stored in this array and returns count of honors students.

public int countHonors(Student[] list, int n)

3) Write a method that accepts an array of student objects, and n, the number of students stored in this array and prints all honors students.

public void printHonors(Student[] list, int n)

4) Write a method that accepts an array of student objects, and n, the number of students stored in this array and returns student with highest gpa. In case of multiple students with same highest gpa return first such student.

public int countHonors(Student[] list, int n)

5) Write a method that accepts an array of student objects, and n, the number of students stored in this array and increases the age of each student object by one.

public void increaseStudentAge(Student[] list, int n)

6) Write a method that accepts an array of student objects, and n, the number of students stored in this array and given target student object. Method returns index where target student object was found in the array if target was found. In case of uncucessful search method returns -1 .

public int search(Student[] list, int n, Student target)

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
In Java programming language Please write code for the 6 methods below: Assume that Student class...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • java A University would like to implement its students registery as a binary search tree, calledStudentBST....

    java A University would like to implement its students registery as a binary search tree, calledStudentBST. Write an Student node class, called StudentNode, to hold the following information about an Student: - id (as a int) - gpa (as double) StudentNode should have constructors and methods (getters, setters, and toString()) to manage Write the StudentBST class, which is a binary search tree to hold objects of the class StudentNode. The key in each node is the id. : import.java.ArrayList; public...

  • I need code in java The Student class: CODE IN JAVA: Student.java file: public class Student...

    I need code in java The Student class: CODE IN JAVA: Student.java file: public class Student {    private String name;    private double gpa;    private int idNumber;    public Student() {        this.name = "";        this.gpa = 0;        this.idNumber = 0;    }    public Student(String name, double gpa, int idNumber) {        this.name = name;        this.gpa = gpa;        this.idNumber = idNumber;    }    public Student(Student s)...

  • Language Java Step 1: Design a class called Student. The Student class should contain the following...

    Language Java Step 1: Design a class called Student. The Student class should contain the following data: firstName lastName studentID totalCredits gpa Your class should implement the “sets” and “gets” for the class. Include methods: equals, compareTo, toString. Change the toString method (from class) to put each member variable on a new line. Step 2: Write a driver program to test that Student works correctly. Test is with 3 students as given in class. Step 3: Write a “registration” program...

  • Given a class called Student and a class called Course that contains an ArrayList of Student....

    Given a class called Student and a class called Course that contains an ArrayList of Student. Write a method called getDeansList() as described below. Refer to Student.java below to learn what methods are available. I will paste both of the simple .JAVA codes below COURSE.JAVA import java.util.*; import java.io.*; /****************************************************** * A list of students in a course *****************************************************/ public class Course{     /** collection of Students */     private ArrayList<Student> roster; /***************************************************** Constructor for objects of class Course *****************************************************/...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

  • In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to...

    In Java(using BlueJ) Purpose Purpose is to practice using file input and output, and array list of objects. Also, this lab specification tells you only what to do, you now have more responsibility to design how to do it. Problem description You are given a text file called 'Students.txt' that contains information on many students. Your program reads the file, creating many Student objects, all of which will be stored into an array list of Student objects, in the Students...

  • In Java: Develop a simple class for a Student. Include class variables; StudentID (int), FirstName, LastName,...

    In Java: Develop a simple class for a Student. Include class variables; StudentID (int), FirstName, LastName, GPA (double), and Major. Extend your class for a Student to include classes for Graduate and Undergraduate. o Include a default constructor, a constructor that accepts the above information, and a method that prints out the contents FOR EACH LEVEL of the object, and a method that prints out the contents of the object. o Write a program that uses an array of Students...

  • Programming Assignment #7 (Recursion) This assignment is to write some methods that perform simple array operations...

    Programming Assignment #7 (Recursion) This assignment is to write some methods that perform simple array operations recursively. Specifically, you will write the bodies for the recursive methods of the ArrayRecursion class, available on the class web page. No credit will be given if any changes are made to ArrayRecursion.java, other than completing the method bodies Note that the public methods of ArrayRecursion – contains(), getIndexOfSmallest(), and sort() – cannot be recursive because they have no parameters. Each of these methods...

  • JAVA program Note: you can't change anything is already written Student.java public class Student {   ...

    JAVA program Note: you can't change anything is already written Student.java public class Student {    private String name;    private String major;    private double gpa;    public Student(String name, String major, double gpa) {        // TO-DO: Assign the given parameters to the data fields. Use the this keyword.    }    public double getGPA() {        // TO-DO: return this.gpa    }    public String getName() {        // TO-DO: return this.name    }...

  • *Java* Hi. I need some help with creating generic methods in Java. Write a program GenMethods...

    *Java* Hi. I need some help with creating generic methods in Java. Write a program GenMethods that has the following generic methods: (1) Write the following method that returns a new ArrayList. The new list contains the nonduplicate (i.e., distinct) elements from the original list. public static ArrayList removeDuplicates(ArrayList list) (2) Write the following method that shuffles an ArrayList. It should do this specifically by swapping two indexes determined by the use of the random class (use Random rand =...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT