Question
Design a user defined class called Course. Each course object will hold data about a course. The data includes courseID, courseName, credits and instructorName. Define
Design a user defined class called Course. Each course object will hold data about a course. The data includes courseID, courseName, credits and instructorName. Define the instance variables required of appropriate type. Provide only get methods along with toString( ) and equals( ) methods. Use JavaDoc style comments.
Design another user defined class called Student. Each student object will hold data on studentID, name, GPA, gender, and courseList. Make sure to define studentID of int type, name as String, gender as a char type and courseList as an array of Course. Declare a static variable named nextID initialized to 1000. nextID will be incremented inside the constructor and its value would be assigned to studentID. Please note the constructor will not require a separate parameter to initialize studentID. Provide only get methods. Also implement the toString( ) and equals( ) methods. Use JavaDoc style comments.
Create a client program with main method. Start by creating Course objects for each of the courses you are taking this semester. Next create two Student objects. Use the course objects you created to populate the courseLists for the two student objects. Demonstrate the various methods of the Student class.
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