I have to implement the code with teacher comments

public class CourseRoster {//Do NOT add or remove any of these data membersprivate String courseName;private String instructorName;private Student[] roster;public CourseRoster(){//Constructs a CourseRoster// DO NOT modify this methodcourseName = “CMSC 131”;instructorName = “Tom R”;roster = null;}public void addStudent(Student newMember){//adds a new item always to the end of the list// This one is already implemented for you//Do NOT modify this methodif (roster == null){roster = new Student[1];roster[0] = new Student(newMember);}else{Student[] tempStudentArr = new Student[roster.length+1];for (int index = 0; index < roster.length; index++){tempStudentArr[index] = roster[index];}tempStudentArr[roster.length] = new Student(newMember);roster = tempStudentArr;}}public String getNames(){// returns the list of student names concatenated together// it will be used in the junit tests to determine if students// were added in the correct order// This one is already implemented for you// Do NOT modify this methodif (roster == null){return null;}else{String list="";for (int index = 0; index < roster.length;index++){list+=roster[index].getName();}return list;}}public int getSize(){//returns the current size of the roster array//This one is already implemented for you// Do NOT modify this methodif (roster == null){return 0;}else{return roster.length;}}public int findIndex(String name){// returns the index for the first occurrence of a Student// in the roster whose name matches that value of the parameter// or returns -1 if that name is not in the listreturn -1;}public int getValues(){//returns the sum of all values of the individual// items in the current array based on the // object's getValue method// if the list is empty, the value 0 is returnedreturn -1;}public int giveMoreAid(){// gives a raise in financial aid to each member of the list// each according to its giveMoreAid method// returns the sum of the return values// of all of the calls to the giveMoreAid methods// if the list is empty, the value 0 is returnedreturn -1;}public boolean removeStudent(String name){// Removes the first student whose name matches// the value of the parameter and returns true- if a student // with that name appears in the roster.// Returns false - if that name does not appear// in the current roster and does not remove anything.// If a student is removed from the roster, the roster array// must remain the exact size needed to hold the number // of Students currently in the class (the size of the array itself// must be one smaller if there is one fewer elements in the list.// If the one being removed is the only student in the list, the// roster should become null (as it was set in the constructor).return false;}}

Related Posts

Quality Writing Features

Price Start $10
  • 24/7 Customer Support
  • All Subject Areas
  • Money-Back Guarantee
  • Timely Delivery
  • Originality report
  • Confidentiality guaranteed

Ordering Homework Writing Service

You can get our ideal online homework help services with four easy steps. All you have to do is inform us of your requirements. Immediately we will match with a specialist in your academic discipline. After that, we will track your order, review it to ensure it meets your requirements, and submit it to your email.


Submit Requirements

Fill in your assignment instructions on the order form


Writer match

Immediately you contact us for homework help; we will assign your assignment to an academic expert.


Quality review

We have a team of editors, who will thoroughly review your assignment, ensuring there are no errors before submission


Get Your Completed Paper

Once we have completed the assignment, we will deliver it to your account. Additionally, we will send a notification to your email.



Budget-friendly writing services



We don’t share our client’s information with a third party



We write every assignment from scratch

Amazing Homework Writing Features

Once you consult us for homework help online services, you will attest to why we are among the USA's best essay writing services.

Read on and find out some of the features that make our services superlative.

Free Homework Writing Services

Free plagiarism checker

You can confirm that the content you get is original for free using our plagiarism checker.

Free samples

We offer unlimited access to our essay homework samples.

Free title page and bibliography

Once you place an order, we format it accordingly without demanding additional charges.

Free unlimited revisions

We offer free unlimited revisions until your assignment is of your desired quality..

Free editing and proofreading

We have a team of specialized editors who review your assignment before submission.

Free customer support

You can track the progress of your homework for free.

Request for Homework Writing Service Today!

We have over 500 homework writing experts, ready and waiting to help you improve your writing skills