15.13. Exercises

  1. Review all of the code associated with the SRS as produced in this chapter, and cite all cases where error handling could be improved.

  2. Use the test scaffold provided in the CourseCatalog class to test the ReadCourseCatalogData and ReadPrerequisitesData methods of that class against all of the following error situations in either the CourseCatalog.dat or Prerequisites.dat files. Edit these files to introduce the following problems one by one, and then run the code to see what happens:

    1. The course name is missing from one of the records in CourseCatalog.dat (i.e., the record only contains two fields instead of three).

    2. The value for credits (the third field in a record) in CourseCatalog.dat is a nonnumeric value, such as "X".

    3. The

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.