Class College
- java.lang.Object
-
- College
-
public class College extends Object
-
-
Constructor Summary
Constructors Constructor Description College(int totalStudents, int totalTextbooks)Public constructor for College class This method initializes an object of College with the given number of students and adds them to the ArrayList, and the given number of books to be held by the college.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddescribe()This method prints out the details of the college including its library and student detailsstatic voidmain(String[] args)Runs the programvoidrunCollege(int nSteps)This method runs the college the specified number of times.
-
-
-
Constructor Detail
-
College
public College(int totalStudents, int totalTextbooks)Public constructor for College class This method initializes an object of College with the given number of students and adds them to the ArrayList, and the given number of books to be held by the college. An object of Random class is also initialized.- Parameters:
totalStudents- Total number of students enrolled into the collegetotalTextbooks- Total number of book available in the college's library
-
-
Method Detail
-
describe
public void describe()
This method prints out the details of the college including its library and student details
-
runCollege
public void runCollege(int nSteps)
This method runs the college the specified number of times.- Parameters:
nSteps- Number of times to run the college
-
main
public static void main(String[] args)
Runs the program- Parameters:
args- string argument e.g 10 15 100 which will be interpreted as totalStudents = 10, totalTextbooks = 15, totalSteps = 100
-
-