C# Programming II – Lesson 12

Chapter 13 Concepts: Exception handling Specialized exception types (Known Exceptions) Try Catch Finally Exception Handling Chapter 13 The C# language’s exception handling features help you deal with any unexpected or exceptional situations that occur when a program is running. Exception handling uses the try, catch, and finally keywords to try actions that may not succeed,…

C# Programming II – Lesson 11

Chapter 12 Concepts: Interface classes Multiple interfaces Interface vs Abstraction Interfaces Interfaces are contracts that define the minimum set of class capabilities. An interface looks like a class, but has no implementation. The only thing it contains are declarations of events, indexers, methods and/or properties. The reason interfaces only provide declarations is because they are…

C# Programming II – Lesson 10

Labs Problem 1: 12.10 (Shape Hierarchy) Implement the Shape hierarchy of Fig. 11.3. Omit the Triangle and Tetrahedron classes. Each TwoDimensionalShape should contain read-only abstract property Area to calculate the area of the two-dimensional shape. Each ThreeDimensionalShape should have readonly abstract properties Area and Volume to calculate the surface area and volume, respectively, of the…

C# Programming II – Lesson 7

Outline Chapter 11 Inheritance Continued (Lab) Problem 11.7 & 11.8 11.7 (Quadrilateral Inheritance Hierarchy) Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the base class of the hierarchy. Make the hierarchy as deep (i.e., as many levels) as possible. Specify the instance variables, properties and methods for each…