Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 28Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started