workshop done
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
|
||||
public class Course {
|
||||
private String courseName;
|
||||
private String courseCode;
|
||||
private int capacity;
|
||||
|
||||
public Course(String courseName, String courseCode, int capacity)
|
||||
{
|
||||
this.courseName = courseName;
|
||||
this.courseCode = courseCode;
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public String getCourseName()
|
||||
{
|
||||
return courseName;
|
||||
}
|
||||
|
||||
public String getCourseCode()
|
||||
{
|
||||
return courseCode;
|
||||
}
|
||||
|
||||
public int getCapacity()
|
||||
{
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public boolean reduceCapacity()
|
||||
{
|
||||
if (capacity > 0)
|
||||
{
|
||||
capacity--;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void increaseCapacity()
|
||||
{
|
||||
capacity++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user