Review 9

Use the material in Chapters 5 and 6 of the Pfleeger/Atlee book to answer these two questions.

  1. The following statements describe modules in a (hypothetical) program. For each, decide whether the module is likely to have a high or low degree of cohesion. If cohesion is low, explain why.

    • Module “InventorySearchByID” searches the records in inventory to see if any match the specified range of ID numbers. A data structure is returned containing any matching records.
    • Module “ProcessPurchase” removes the purchased product from inventory, prints a receipt for the customer and updates the log.
    • Module “FindSet” processes the user's request, determines the set of items from inventory that match the request, and formats the items into a list that can be shown to the customer.
  2. In what ways do the Object-Oriented characteristics of encapsulation and information hiding support reuse? What kind of criteria would you use in deciding whether to reuse a class in a new system?

Please submit your work by uploading either a .txt document or a .pdf document containing your answers to these questions. Do NOT submit .doc, .docx, .odt, or other document formats. (Note to Microsoft Word users: If you don't want to create a .pdf document, Word should provide a "Save as Text" command to create a .txt version of your document.)

In-class students: Submit your work for this assignment by 11:55 PM on Sunday, April 6th.

CAETE students: Submit your work for this assignment by 11:55 PM on Sunday, April 13th.

Kenneth M. Anderson, 2008.