Question: Please help me with this assignment, thank you! **Course.java** public class Course { int deptNum; int courseNum; public Course(int deptNum, int courseNum){ this.deptNum = deptNum;
Please help me with this assignment, thank you!

**Course.java**
public class Course { int deptNum; int courseNum; public Course(int deptNum, int courseNum){ this.deptNum = deptNum; this.courseNum = courseNum; } public String toString( ){ return deptNum + ":" + courseNum; } }
**Roster.java**
public class Roster { Student [ ] students; int numStudents; int stopPoint; Course course; /** * The constructor for this class. * Initialize this roster to empty, i.e., holds no students, * with given stop point and course */ public Roster(int stopPoint, Course course){ // replace this line with your code } /** * toString is a method every class has. It returns a string * that represents the object for printing */ public String toString( ){ String res = ""; for(int j = 0; j **Student.java**
public class Student { String personalName; String familyName; public Student(String pName, String fName){ personalName = pName; familyName = fName; } public String toString( ){ return "Student: " + familyName + ", "+ personalName; } } **TestRoster.java**
public class TestRoster { /** * @param args */ public static void main(String[] args) { Student s1 = new Student("John","Doe"); Course c1 = new Course(198, 111); Roster r1 = new Roster(4, c1); System.out.println(r1); testAdd(r1, s1); } private static void testAdd(Roster r, Student s){ System.out.println(s.familyName+" "+r.addStudent(s)); System.out.println(r); } } Thanks again!
This assignment. involves a program made up of several Java classes: An object of class Course represents a course, e.g. 198:11 1 . A course has a department number and a course number. An object of class Student represents a student. A student has a personal (first) name and a family (last) name. An object of class Roster represents a particular section of a course. A roster has an array of students, an int numStudents, that says how many students there are in the section, an int stopPoint that gives the maximum number of students that may be in the section, and a course that says which course this roster is a section of. Note that the students are not in any particular order in the array, but they will be in the first numStudents elements of the array The class TestRoster that has a main method that can be used for testing Roster. Of course you will need to add tests to TestRoster - this is just a framework to get you started o There will never be an object that is an instance of the class TestRoster. Your task is to finish Roster java by replacing each line marked "/ replace this line with your code" with code that makes the method do what its comment says it does. There are 4 such lines Some rules to follow You may not change Course.java or Student.java. (You will not be handing these in, anyway.) You may put any code you want in TestRoster.java to test your code. (You will not hand this is, either.) You must replace each of the lines in Rosterjava marked "replace this line". (Replace them with as many lines of code as you want.) You may add methods to Roster java as long as they are private You may not make any other changes to Roster.java Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
