Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Each Student object consists of name, id , cgpa and a Registration object. This Student class uses the Registration object as one of its instance
Each Student object consists of name, id cgpa and a Registration object. This Student class uses the Registration object as one of its instance variables to keep track of the information related to registration of a student. When a student adds or drops a course, hisher Registration object gets updated. public class Student private String name; private int id; private double cgpa; private Registration reg; public StudentString name, int id double cgpa this.name name; this.id id; this.cgpa cgpa; getter and setter methods public void makeNewRegistration reg new Registration; public void addCourseCourse course public void dropCourseCourse course Question: Write down the coding for dropCourse and addCourse with necessary comments
Each Student object consists of name, id cgpa and a Registration object. This Student
class uses the Registration object as one of its instance variables to keep track of the
information related to registration of a student. When a student adds or drops a course, hisher
Registration object gets updated.
public class Student
private String name;
private int id;
private double cgpa;
private Registration reg;
public StudentString name, int id double cgpa
this.name name;
this.id id;
this.cgpa cgpa;
getter and setter methods
public void makeNewRegistration
reg new Registration;
public void addCourseCourse course
public void dropCourseCourse course
Question: Write down the coding for dropCourse and addCourse with necessary
comments
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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