Question: JAVA requirements test cases: input: screenshot output: screenshot thanks for helping Practice 3 3. (The Course class) Revise the Course class as follows: The array

JAVA requirements test cases: input: screenshot output: screenshot

JAVA requirements test cases: input: screenshot output: screenshot thanks for helping Practice

3 3. (The Course class) Revise the Course class as follows: The

thanks for helping

Practice 3 3. (The Course class) Revise the Course class as follows: The array size is fixed in Listing 10.6. Improve it to automatically increase the array size by creating a new larger array and copying the contents of the current array to it. | Implement the dropStudent method. Add a new method named clear() that removes all students from the course. Write a test program that creates a course, adds three students, removes one, and displays the students in the course. create students 4 6 add a course 11 12 LISTING 10.6 Course.java 1 public class Course { 2 private String courseName; 3 private String[] students = new String(100); private int numberOfStudents; 5 public Course(String courseName) { 7 this.courseName - courseName; 8 } 9 10 public void addStudent (String student) { students [numberOfStudents] - student; numberOfStudents++; 13 } public String[] getStudents() { return students; 17 } 18 public int getNumberOfStudents() { 20 return numberOfStudents; 21 } 22 public String getCourseName() { return courseName; } 26 27 public void dropStudent(String student) { // Left as an exercise in Programming Exercise 10.9 29 } 30} 14 15 16 return students 19 number of students 23 24 25 28

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!