Learning path

C# practice exercises

Short, practical C# exercises: parsing input, formatting, dates, tuples, collections and custom exceptions.

11 lessons · 16 challenges

Start the path →
  1. Lesson 1 challenge Validate Input with TryParse Parse user input without using exceptions for ordinary validation.
  2. Lesson 1 challenge Switch Expression Calculator Build a calculator with a C# switch expression.
  3. Lesson 1 challenge Invoice and Numeric Formatting Format aligned currency output with interpolation.
  4. Lesson 2 challenges DateOnly Appointment Scheduler Calculate dates with DateOnly and DayOfWeek.
  5. Lesson 2 challenges Return Statistics with Tuples Return several named results without creating a class.
  6. Lesson 1 challenge Generic Task List Manage typed task records with List<T>.
  7. Lesson 2 challenges Word Frequency Dictionary Count normalized words with Dictionary<TKey,TValue>.
  8. Lesson 2 challenges Unique Tags with HashSet Normalize and deduplicate tags.
  9. Lesson 1 challenge Encapsulated Bank Account Protect a balance with validated domain methods.
  10. Lesson 2 challenges Custom Domain Exception Create and catch an exception that expresses a business failure.
  11. Lesson 1 challenge Pattern Matching Classifier Classify mixed values with property and relational patterns.