ICT 214 Mock exam

  1. A description of a system is

    A library has a collection of books arranged in sections such as Fiction, Bibliography, History, etc. Each book has a title, author and Dewey decimal clasification number. Each section has a name and stores a range of classification numbers. You can add books to the librar whereby they are added to sections. You can also borrow books for a period. Sometimes books are lost, so they are removed from the library's catalogue.
    1. Identify the classes in this system
    2. Identify the attibutes of the classes
    3. Identify the methods of the classes
    4. Draw a UML class diagram of this system

  2. A car has an attribute of speed. When created, the car is at rest, with a speed of zero. The car can accelerate or decelerate, changing its speed by one unit each time. It can also "emergency stop", changing its speed to zero.

    Write Java code to implement the Car class and its methods.

  3. Write Java code to implement the following algorithms

    1. A date object has two attibutes day (1..31) and month (1..12). Write Java code to increase the date by one day
    2. Given an array of integers, write Java code to test if the array is ordered (i.e. a[0] <= a[1] ...)
  4. Identify the GUI objects in the following application

  5. A login panel consists of two labels (user-name and password), two text fields for data entry and a Submit button. Write Java code to create this in a JPanel, so that when the Submit button is clicked the name and password are printed to standard output.
  6. Detail the additions that would need to be made to your client and server code to implement an extra command LIST_DIRS which will return only the directories in the server's current directory. Hint: the class File has a boolean method isDirectory() which returns true (false) if the file is (is not) a directory