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

Question #246030

StudentLoans class

1 Code a no-argument constructor. In this constructor, a) Add 2 Student objects to the Students array. b) Add 2 PostGraduate objects to the Students array. c) Set noOfStudents to 4.

2 Code a method menu() that returns an int value. This value represents the choice the user has made from the available menu options. a) Define a Scanner variable to read from the keyboard. b) Define an int value, named choice. c) Display a menu in the following format:

1: Add student

2: Display students

3: Display interest

4: Exit

d) Read the user’s choice from the keyboard.

e) Return the choice read from the keyboard.


1
Expert's answer
2021-10-04T12:43:23-0400
import com.demo.Student;
import com.demo.PostGraduate;

public class StudentLoans {
  private List<Student> students;
  private int noOfStudents;
  public StudentLoans() {
    students = new ArrayList<Students>();
    students.add(new Student());
    students.add(new Student());
    students.add(new PostGraduate());
    students.add(new PostGraduate());
    noOfStudents = 4;
  }
  public void menu() {
    // here imple...
  }
}

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