Sample lab exam


Previous page | Next page


Open textbook, open notes (hardcopy, not online). No other help.

Examples of typical problems are below. In the actual exam you are given one such problem.

  1. Add a menu option '2' to Assignment 3 that lets the user remove every other entry from the catalog, i.e., remove the 2nd, 4th, 6th, 8th, ... entries.
  1. Add a menu option 'm' to Assignment 3 that lets the user remove all those entries from the catalog whose author field is an empty string, i.e., a string whose length is 0.

    You may assume that the very first and the very last entry in the catalog do not have an author field that is an empty string.

  1. Add a menu option 'z' to Assignment 3 that lets the user throw away all but one of the entries in the current list of 'hits'. The one entry to keep is the last one in the list.
  1. Add a menu option 't' to Assignment 3 that cuts the current list of 'hits' down to its first ten entries (and leaves it unchanged if it contains no more than ten entries).


Previous page | Next page | Back to top

3:40 PM, Thursday, December 12, 2002