Class College


  • public class College
    extends Object
    • 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 college
        totalTextbooks - 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