Solutions to the exercises in the book
(H.Mössenböck: C# to the Point, Addison Wesley, 2005)
1. C# and the .NET Framework
- Suitability of C# for large-scale software projects
- Features of .NET
- Security
- Interoperability
- Assemblies
- Internet resources
- Mono
2. Getting started
- Compiling and executing a program
- Working with a development environment
- Online documentation
- Multi-file programs
- Symbols
3. Types
- Type system
- Primitive types
- Enumerations
- Enumerations
- Arrays
- Arrays
- Arrays
- Strings
- StringBuilder
- Classes
- Structs
- Classes versus Structs
4. Expressions
- Priority of operators
- Result type of expressions
- Short-circuit evaluation
- Simplifying Boolean expressions
- Run-time type information
5. Declarations
- Namespaces
- Namespaces
- Declarations using the same name
- Declaration rules
- Visibility of names
- Inner statement blocks
6. Statements
- if statement
- switch statement
- switch statement
- Loop transformations
- Search loop
7.Input and output
- Removing comments
- Formatted output
- Formatted output
- Formatted input
8. Classes and structs
- Structs
- Classes
- Static variables and methods
- Structs and properties
- Parameter passing modes
- Variable number of parameters
- Cross-reference list
9. Inheritance
- Access modifiers
- Compatibility between classes
- Inheritance and constructors
- Type cast
- Hiding methods
- Subclasses
- Object-oriented design
- Dynamic binding
- Abstract classes
- Methods of Object
10. Interfaces
- Abstract classes and interfaces
- Multiple interface inheritance
- IComparable interface
- IDumpable interface
- foreach and interfaces
11. Delegates und Events
- Sorting arrays
- Trigger
- Trapping events in the file system
- Delegates with state
12. Exceptions
- Using exception handling
- Conversion errors
- Exceptions when opening a file
- User-defined exception classes
- Hierarchy of exception classes
- finally
13. Namespaces and assemblies
- Types with the same name from different namespaces
- Namespaces, assemblies, DLLs
- Version checking
- Security
- Strong names
- Global assembly cache
- Decoding assemblies
14. Threads
- Input/output threads
- File comparison
- Thread synchronization
- Dining philosophers
- Comparing C# and Java
15. Attributes
- Conditional atribute
- Serializing
- ISerializable
- User-defined attributes
16. Documentation Comments
- Commenting a class
- Formatting comments
17. Interoperability with COM
- Microsoft Agent
- Calling a .NET program from COM
18. Extract from the .NET class library
- Calculating dates
- Trigonometry
- Minimum distance between points
- Normal distribution
- Sorted directory
- Number sequences
- Outputting Windows system variables
- Phone book
- Counting the frequency of words
- Character statistics
- Iteration through binary trees
- Memory streams
- Binary files
- Properties of a class
- Scripting environment
19. Case studies
- Calculator
- Web service for a book shop
- Web interface using ASP.NET
|