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
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