I am in a java class and I have figured out everything for what we need to do besides one part, which might just be because I am not understanding so I will show what the questions are (only because I am not sure if they will help to make the question I need help on more clear) and I will put the one I need help on in bold. And then I will show what I have so far just for that part.
**Hopefully I am approaching getting help on this in the right way, up until this point I have been figuring everything out on my own and have never used a forum for java before! :)
I just do not understand what is supposed to be checked by the method...?Quote:
The methods to be implemented are listed below. Note that using the right case is extremely important.
a constructor that takes the department and number (in that order) and creates a new instance of a course.
String toString() that returns a String with the department name, followed by the number, colon, space, crn, dash, and course name. For example, "CS160: 32456-Foundations in Programming"
String getDepartment(): returns the department as a String
int getNumber(): returns the number as an int
String getName(): returns the name as a String
int getCrn(): returns the number as an int
int getMaxEnrollment(): returns the number as an int
int getActualEnrollment(): returns the number as an int
void setName(String name): sets the course name
void setCrn(int crn): sets the crn
void setMaxEnrollment(int n): sets the max enrollment forthe course
boolean isSpaceAvailable(): returns true if actual enrollment is less than max enrollment, false otherwise
addStudent(): increments actual enrollment by 1. It is the caller's responsibility to first check if there is space.
removeStudent(): decrements actual enrollment by 1. It is the method's responsibility to check if there is a student to remove.
Here is what I have:
public int removeStudent()
if(actualEnrollment > 0)
remove = actualEnrollment - 1;
actualEnrollment = remove;
If you need to see more of what I have, just let me know!
Thanks in advance!!!!