Answer to Question #246035 in Java | JSP | JSF for Chadwin Fritz

Question #246035

StudentLoans class 

5 Code a method displayAllStudents(). This method has no parameters and is void. This method displays all the objects in the array.

a) Display a heading .

b) Loop through the array and use the show() of every object to display the object details. c) Print a line after each object is displayed. Example of expected output:

Displaying all students

--------------------

Student details

Name: Smittie

Student number: 12345

Loan amount: 10000.0

-------------------------

Student details Name: Jannie

Student number: 67543

Loan amount: 50000.0

-------------------------


1
Expert's answer
2021-10-05T18:15:06-0400
public class StudentLoans {
    private Student[] students;

    public void displayAllStudents() {
        System.out.println("Displaying all students ");
        for (Student student : students) {
            System.out.println("--------------------");
            student.show();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS