Ok, I am trying to understand what is being asked next / how to do it for my Java assignnment... Here's is how it starts and what I understand- "Create a Student class containing an ID number and an array of 5 CollegeCourse subjects. Create a get and set method for the student ID number."...Here's what I have so far: public class Student { private int sID; CollegeCourse[]obj = new CollegeCourse[5]; public int getSID() { return sID; } public void setSID(int SIDNum) ______________ Now, what I don't understand is the rest of what it ask for which is this- "Also create a get method that returns one of the Student's CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4). Next create a set method that sets the value of one of the Student's CollegeCourses; the method takes 2 arguments- a CollegeCourse and an integer representing the CollegeCourse's position (0 through 4). Can you help me understand this request/ break down what this is asking for? I'm super new to Java and stupidly took a flex "on your own" course which was not a good idea at all. I'm trying hard to get through it and really understand what I am being asked to do and how to do it. I'd really apprecate any help. -Also, below is the first part of the assignment I understand and that leads into the 2nd part I don't understand about on the Student class. public class CollegeCourse { private String courseID; private int creditHours; private char letterGrade; public String getCourseID() { return courseID; } public int getCreditHours() { return creditHours; } public char getLetterGrade() { return letterGrade; } public void setCourseID(String idNum) { courseID=idNum; } public void setCreditHrs(int ch) { creditHrs=ch; } public void setLetterGrade(char gd) { letterGrade=gd; } }
Ok, I am trying to understand what is being asked next / how to do it for my Java assignnment...
Here's is how it starts and what I understand-
"Create a Student class containing an ID number and an array of 5 CollegeCourse subjects. Create a get and set method for the student ID number."...Here's what I have so far:
public class Student
{
private int sID;
CollegeCourse[]obj = new CollegeCourse[5];
public int getSID()
{
return sID;
}
public void setSID(int SIDNum)
______________
Now, what I don't understand is the rest of what it ask for which is this-
"Also create a get method that returns one of the Student's CollegeCourses; the method takes an integer argument and returns the CollegeCourse in that position (0 through 4).
Next create a set method that sets the value of one of the Student's CollegeCourses; the method takes 2 arguments- a CollegeCourse and an integer representing the CollegeCourse's position (0 through 4).
Can you help me understand this request/ break down what this is asking for? I'm super new to Java and stupidly took a flex "on your own" course which was not a good idea at all. I'm trying hard to get through it and really understand what I am being asked to do and how to do it. I'd really apprecate any help.
-Also, below is the first part of the assignment I understand and that leads into the 2nd part I don't understand about on the Student class.
public class CollegeCourse
{
private String courseID;
private int creditHours;
private char letterGrade;
public String getCourseID()
{
return courseID;
}
public int getCreditHours()
{
return creditHours;
}
public char getLetterGrade()
{
return letterGrade;
}
public void setCourseID(String idNum)
{
courseID=idNum;
}
public void setCreditHrs(int ch)
{
creditHrs=ch;
}
public void setLetterGrade(char gd)
{
letterGrade=gd;
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images