Question: JAVA The Student Class: A Student has a Name-first and last name seperated by a space Student ID-id starts at 100, assigned using a static

JAVA

The Student Class:

A Student has a

Name-first and last name seperated by a space

Student ID-id starts at 100, assigned using a static variable

All instance variable and getters and setters for all instance variables. A toString method in the format "Student: John Jones; ID: 101"

The Course Class:

Course

-courseName:String

-students: Student[]

-numberOfStudents: int

+Course(courseName: String)

+getCourseName(): String

+addStudent(student:Student): void

+addStudent(studentName: String): void

+dropStudent(studentId: int): void

+getStudents(): Student[]

+getNumberOfStudents(): int

The array of students allows for up to 10 students. Number of Students in coinstructer sets to 0. Three getters for getCourseName(): String, getStudents(): Student[], and getNumberOfStudents(): int. Two setters for addStudent(student: Student): void and addStudent(studentName: String): void. a toString method in the format of

Course: Calculus; Number Of Students: 4

The Students in the class are:

Student: Mary Smith; ID: 100

Student: John Jones; ID: 101

Student: Susan Thompson; ID: 102

Student: George Johnson; ID: 103

TestCourse

prompt the user for the name of a Course and create a Course object. In a loop, until the user enters a q or a Q; prompt the user to enter student names or Q to end, for each student entered, create a Student object and add it to the Course using addStudent method the Course class has. At the end of the loop, print the Course object using its toString method.

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!