diff --git a/C# Language Features/Control Flow Statements/DoWhile/DoWhile.csproj b/C# Language Features/Control Flow Statements/DoWhile/DoWhile.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/DoWhile/DoWhile.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C# Language Features/Control Flow Statements/DoWhile/Program.cs b/C# Language Features/Control Flow Statements/DoWhile/Program.cs
new file mode 100644
index 0000000..a141f78
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/DoWhile/Program.cs
@@ -0,0 +1,74 @@
+namespace DoWhileLoopExample;
+class Program
+{
+ ///
+ /// Main entry point of the application, demonstrating the use of a `do-while` loop.
+ /// The program repeatedly prompts the user to enter a positive number, validating input.
+ ///
+ static void Main(string[] args)
+ {
+ int number;
+
+ // do-while loop structure:
+ // The do-while loop executes a block of code once before checking the condition.
+ // After the first execution, it checks the condition to decide if the loop should continue.
+ //
+ // Syntax:
+ // do
+ // {
+ // // Code to execute at least once
+ // }
+ // while (condition);
+
+ // Begin do-while loop to ensure the code block runs at least once.
+ do
+ {
+ Console.Write("Please enter a positive number: ");
+
+ // Attempt to parse the input as an integer.
+ // If parsing fails, it will set number to -1 to ensure re-prompting in the loop.
+ bool isValidInput = int.TryParse(Console.ReadLine(), out number);
+
+ // Validation:
+ // - isValidInput checks if the input is a valid integer.
+ // - number > 0 ensures that the input is positive.
+ // If either condition fails, the loop will run again to re-prompt.
+ if (!isValidInput || number <= 0)
+ {
+ Console.WriteLine("Invalid input. Make sure to enter a positive number.\n");
+ }
+
+ } while (number <= 0); // Condition to keep looping if number is not positive.
+
+ // Once the user enters a valid positive number, the loop exits.
+ Console.WriteLine($"\nThank you! You've entered a positive number: {number}");
+
+ // Explanation of the do-while loop in this example:
+ // 1. The code inside the do block runs at least once, regardless of the condition.
+ // 2. After each execution, the while condition (number <= 0) is checked.
+ // 3. If the condition is true, the loop continues, re-prompting the user for input.
+ // 4. If the condition is false (i.e., a positive number is entered), the loop exits.
+
+ // Key Characteristics of a do-while loop:
+ // - Ensures that the code inside the loop runs at least once, even if the condition is initially false.
+ // - Typically used when we need one guaranteed execution (like prompting for user input).
+ // - The condition is evaluated only after the code block has executed.
+
+
+ // Best Practices for `do-while` Loops:
+
+ // 1. Use When at Least One Execution is Required:
+ // - `do-while` is best suited for scenarios where the loop body needs to run at least once, such as user input validation.
+
+ // 2. Avoid Using When Condition May Be Initially False:
+ // - Only use `do-while` when it's acceptable for the loop body to run even if the condition could initially be false.
+
+ // 3. Ensure Exit Condition is Reachable:
+ // - Make sure the loop body modifies a variable or state so that the `while` condition can eventually be false.
+ // - This helps avoid infinite loops and ensures the loop exits as expected.
+
+ // 4. Keep the Loop Body Short and Focused:
+ // - Since `do-while` loops can be harder to understand at a glance, aim to keep the body concise and clear.
+
+ }
+}
\ No newline at end of file
diff --git a/C# Language Features/Control Flow Statements/ForLoop/ForLoop.csproj b/C# Language Features/Control Flow Statements/ForLoop/ForLoop.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/ForLoop/ForLoop.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C# Language Features/Control Flow Statements/ForLoop/Program.cs b/C# Language Features/Control Flow Statements/ForLoop/Program.cs
new file mode 100644
index 0000000..ebe69f5
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/ForLoop/Program.cs
@@ -0,0 +1,77 @@
+namespace ForLoopExample;
+class Program
+{
+ ///
+ /// Main entry point of the application, demonstrating the use of a `for` loop
+ /// by calculating the sum of numbers from 1 to a specified maximum.
+ ///
+ static void Main(string[] args)
+ {
+ // Define the maximum number for summation.
+ // This could come from user input or a data source in a real-world application.
+ int maxNumber = 10;
+ Console.WriteLine($"Calculating the sum of numbers from 1 to {maxNumber}...\n");
+
+ // for loop structure:
+ // The for loop is a control flow structure used to repeat a block of code a specific number of times.
+ // It consists of three main parts:
+ // 1. Initialization: Runs once before the loop starts. This sets up the loop variable (e.g., int i = 1).
+ // 2. Condition: Evaluated before each iteration. The loop continues as long as this condition is true (e.g., i <= maxNumber).
+ // 3. Iterator/Update: Runs after each loop iteration to update the loop variable (e.g., i++ to increment by 1).
+ //
+ // Syntax of a for loop:
+ // for (initialization; condition; update)
+ // {
+ // // Code to execute during each loop iteration
+ // }
+
+ // Variable to store the cumulative sum
+ int sum = 0;
+
+ // Begin for loop to calculate the sum from 1 to maxNumber.
+ for (int i = 1; i <= maxNumber; i++)
+ {
+ // Inside the loop:
+ // - i represents the current number being added to the sum.
+ // - The loop will run as long as i is less than or equal to maxNumber.
+
+ sum += i; // Add the current value of i to sum.
+
+ // Print each step to demonstrate the calculation in real-time.
+ Console.WriteLine($"Adding {i}, current sum: {sum}");
+ }
+
+ // Output the final sum after the loop completes.
+ Console.WriteLine($"\nThe total sum from 1 to {maxNumber} is: {sum}");
+
+ // Summary of the for loop in this example:
+ // 1. The loop starts with i = 1 (initialization).
+ // 2. It checks if i <= maxNumber before each loop (condition).
+ // 3. After each iteration, i is incremented by 1 (i++), progressing towards maxNumber.
+ // 4. The loop stops when i exceeds maxNumber, and the final sum is displayed.
+
+ // Advantages of using a for loop:
+ // - Provides a clear, concise syntax for repeating code with a known number of iterations.
+ // - Ideal for situations where you know the number of times the loop should run in advance.
+
+
+ // Best Practices for `for` Loops:
+
+ // 1. Choose the Right Loop Type:
+ // - Use a `for` loop when the number of iterations is known or can be calculated.
+ // - Avoid using `for` loops when a different structure (like `while`) would improve readability.
+
+ // 2. Avoid Modifying Loop Counter Inside the Loop Body:
+ // - Changing the loop variable (`i`) inside the loop body can lead to confusing and hard-to-debug code.
+ // - Instead, modify only within the loop’s initialization, condition, or increment sections.
+
+ // 3. Limit Scope of Loop Variables:
+ // - Use loop variables that are limited to the loop’s scope (e.g., `for (int i = 0; i < n; i++)`).
+ // - This helps prevent accidental misuse outside the loop.
+
+ // 4. Minimize Operations Inside the Loop Condition:
+ // - Avoid performing complex calculations in the loop condition as it will execute on every iteration.
+ // - Move constant expressions outside the loop for better performance.
+
+ }
+}
\ No newline at end of file
diff --git a/C# Language Features/Control Flow Statements/IfElse/IfElse.csproj b/C# Language Features/Control Flow Statements/IfElse/IfElse.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/IfElse/IfElse.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C# Language Features/Control Flow Statements/IfElse/Program.cs b/C# Language Features/Control Flow Statements/IfElse/Program.cs
new file mode 100644
index 0000000..6f42ccd
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/IfElse/Program.cs
@@ -0,0 +1,121 @@
+namespace IfElseExample;
+
+class Program
+{
+ ///
+ /// The main entry point of the application, which evaluates a student's score
+ /// and assigns a grade based on predefined criteria using if-else statements.
+ ///
+ static void Main(string[] args)
+ {
+ // Initialize a sample score for evaluation.
+ // In a real application, this score could be user input or retrieved from a database.
+ int score = 85;
+ Console.WriteLine("Student Score: " + score);
+
+ // if-else structure explanation:
+ // The if-else control structure allows us to execute code conditionally.
+ // Each 'if' checks a specific condition (a true/false statement).
+ // - If the condition evaluates to true, the associated block of code runs.
+ // - If false, it moves to the next 'else if' or 'else' block.
+ // This allows us to handle multiple scenarios in sequence, providing different outputs depending on the conditions.
+
+ // Basic syntax of if-else:
+ // if (condition)
+ // {
+ // // Code to run if condition is true
+ // }
+ // else if (anotherCondition)
+ // {
+ // // Code to run if previous condition is false, but this one is true
+ // }
+ // else
+ // {
+ // // Code to run if all previous conditions are false
+ // }
+
+ // Example of if-else in action:
+
+ if (score >= 90)
+ {
+ // This block executes if the score is 90 or above.
+ // 'if' keyword starts the condition, and the expression inside the parentheses (score >= 90)
+ // is the condition. Here, we're checking if 'score' is greater than or equal to 90.
+ // - If true: The statements inside this block run, assigning a grade of 'A'.
+ // - If false: It moves to the next 'else if' block.
+ Console.WriteLine("Grade: A");
+ Console.WriteLine("Remark: Excellent performance.");
+ }
+ else if (score >= 80)
+ {
+ // This block only runs if the previous 'if' condition is false (score < 90),
+ // and this condition (score >= 80) is true.
+ // 'else if' adds another condition to check after the initial 'if' fails.
+ // This block is only reached if the score is between 80 and 89.
+ Console.WriteLine("Grade: B");
+ Console.WriteLine("Remark: Good job! Keep pushing for an 'A'.");
+ }
+ else if (score >= 70)
+ {
+ // Additional 'else if' blocks can be added to handle more specific cases.
+ // This block only runs if both previous conditions (score >= 90 and score >= 80) are false,
+ // and if this condition (score >= 70) is true. In this case, it assigns a grade of 'C'.
+ Console.WriteLine("Grade: C");
+ Console.WriteLine("Remark: Fair effort, but there's room for improvement.");
+ }
+ else if (score >= 60)
+ {
+ // This block checks if all previous conditions are false and the score is between 60 and 69.
+ // The 'else if' is useful for checking a specific range and avoids redundant conditions.
+ Console.WriteLine("Grade: D");
+ Console.WriteLine("Remark: You passed, but aim for a higher score next time.");
+ }
+ else
+ {
+ // The 'else' statement catches any cases not covered by the previous conditions.
+ // - 'else' does not have a condition; it runs if none of the previous 'if' or 'else if' statements are true.
+ // This is a "catch-all" block for scores below 60, assigning a grade of 'F'.
+ Console.WriteLine("Grade: F");
+ Console.WriteLine("Remark: Unfortunately, this is a failing grade. Consider reviewing the material.");
+ }
+
+ // The if-else structure concludes here.
+ // Once a condition is met and its block runs, the entire structure is exited.
+ // For instance, if score is 85, only the 'else if (score >= 80)' block runs, and none of the others are checked.
+
+ // Final message for user interaction.
+ Console.WriteLine("\nGrade evaluation complete. Remember to keep improving and aim higher!");
+
+ // Summary of if-else control flow in this example:
+ // 1. The program checks each 'if' or 'else if' condition in order.
+ // 2. As soon as it finds a true condition, it executes that block and skips the rest.
+ // 3. If none of the conditions are true, it defaults to the 'else' block.
+ // This allows efficient branching where only one path is taken depending on the first true condition.
+
+
+ // Best Practices for `if-else` Statements:
+
+ // 1. Minimize Nested `if` Statements:
+ // - Deeply nested `if` statements can make code hard to read and maintain.
+ // - Use guard clauses to exit early, especially if certain conditions make further checks unnecessary.
+ // Example:
+ //if (!isValid) return; // Guard clause instead of additional nesting.
+
+ // 2. Use `else if` for Mutually Exclusive Conditions:
+ // - To avoid multiple `else` levels, use `else if` for conditions that are mutually exclusive.
+ // - This improves readability and avoids unnecessary condition checks.
+
+ // 3. Avoid Redundant Conditions:
+ // - If conditions overlap, ensure that only the necessary checks are used.
+ // - Redundant checks can lead to inefficient code and may cause logical errors.
+
+ // 4. Be Cautious with Floating Point Comparisons:
+ // - When comparing floating-point numbers, avoid direct equality checks due to precision issues.
+ // - Instead, check if the difference is within a small tolerance, e.g., `Math.Abs(a - b) < tolerance`.
+
+ // 5. Use Ternary Operators for Simple Assignments:
+ // - For simple conditional assignments, consider using the ternary operator to keep the code concise.
+ // Example:
+ //int ageCategory = age > 18 ? "Adult" : "Minor";
+ }
+}
\ No newline at end of file
diff --git a/C# Language Features/Control Flow Statements/Switch/Program.cs b/C# Language Features/Control Flow Statements/Switch/Program.cs
new file mode 100644
index 0000000..cfa52cc
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/Switch/Program.cs
@@ -0,0 +1,159 @@
+using System;
+
+namespace SwitchExample;
+
+class Program
+{
+ ///
+ /// The main entry point of the application, which evaluates a student's grade
+ /// and provides feedback based on predefined criteria using a switch-case statement.
+ ///
+ static void Main(string[] args)
+ {
+ // Initialize a sample grade for evaluation.
+ // In a real-world scenario, this might come from user input or a data source.
+ char grade = 'B';
+ Console.WriteLine("Student Grade: " + grade);
+
+ // Switch-case structure explanation:
+ // The switch statement is a control flow tool for evaluating a single expression
+ // against multiple potential cases. Each case represents a specific match condition.
+ // - If a case matches the expression, the code within that case block is executed.
+ // - The switch provides an efficient way to branch to different sections of code based on the value.
+ // - A default case can be included to handle any value not specifically covered by the cases.
+
+ // Basic syntax of switch-case:
+ // switch (expression)
+ // {
+ // case constant1:
+ // // Code to run if expression == constant1
+ // break;
+ // case constant2:
+ // // Code to run if expression == constant2
+ // break;
+ // default:
+ // // Code to run if no case matches the expression
+ // break;
+ // }
+
+ // Example of switch-case in action:
+
+ switch (grade)
+ {
+ case 'A':
+ // The 'case' keyword checks if the variable 'grade' matches the character 'A'.
+ // If true, this block executes, and the feedback message below is displayed.
+ Console.WriteLine("Excellent performance!");
+ Console.WriteLine("Keep up the outstanding work!");
+ break; // 'break' exits the switch statement, preventing further cases from running.
+
+ case 'B':
+ // This case checks if 'grade' equals 'B'.
+ // If so, it provides feedback specific to a 'B' grade.
+ Console.WriteLine("Good job!");
+ Console.WriteLine("You're doing well but keep pushing for an 'A'.");
+ break; // 'break' is necessary to prevent falling through to the next case.
+
+ case 'C':
+ // This case runs if 'grade' equals 'C'.
+ // It displays feedback appropriate for a 'C' grade.
+ Console.WriteLine("Fair effort.");
+ Console.WriteLine("Consider reviewing the material to improve.");
+ break;
+
+ case 'D':
+ // Runs if 'grade' equals 'D'.
+ // Provides specific feedback to motivate improvement.
+ Console.WriteLine("You passed, but there's room for improvement.");
+ Console.WriteLine("Consider seeking extra help or additional study.");
+ break;
+
+ case 'F':
+ // This case handles the 'F' grade.
+ // Feedback here is encouraging but emphasizes the need for significant improvement.
+ Console.WriteLine("Unfortunately, this is a failing grade.");
+ Console.WriteLine("Don't give up! Review the material and ask for help if needed.");
+ break;
+
+ default:
+ // The 'default' case handles any value of 'grade' that isn't covered above.
+ // Useful for cases where unexpected input could occur.
+ // Here, it warns of an invalid grade input.
+ Console.WriteLine("Invalid grade entered.");
+ Console.WriteLine("Please enter a valid grade (A, B, C, D, or F).");
+ break;
+ }
+
+ // Switch expression:
+ // In C# 8+, we can use a switch expression to directly return a result based on
+ // the evaluated value. This can make code shorter, more readable, and expressive.
+ //
+ // Syntax:
+ // var result = expression switch
+ // {
+ // pattern1 => result1,
+ // pattern2 => result2,
+ // _ => defaultResult
+ // };
+ //
+ // Here, 'grade' is matched against different character patterns ('A', 'B', etc.),
+ // and each pattern returns a corresponding string message.
+
+ // Using switch expression to evaluate the grade and provide feedback.
+ string feedback = grade switch
+ {
+ 'A' => "Excellent performance!\nKeep up the outstanding work!",
+ 'B' => "Good job!\nYou're doing well but keep pushing for an 'A'.",
+ 'C' => "Fair effort.\nConsider reviewing the material to improve.",
+ 'D' => "You passed, but there's room for improvement.\nConsider seeking extra help or additional study.",
+ 'F' => "Unfortunately, this is a failing grade.\nDon't give up! Review the material and ask for help if needed.",
+ _ => "Invalid grade entered.\nPlease enter a valid grade (A, B, C, D, or F)." // '_' is the default pattern in switch expressions.
+ };
+
+ // Explanation of the switch expression used here:
+ // - The 'grade switch' expression simplifies the multiple 'case' blocks into a single expression.
+ // - Each case is represented as 'pattern => result', and multiple cases are evaluated quickly.
+ // - The '_' symbol is the default pattern, covering any values not explicitly matched (like invalid inputs).
+ // - This approach reduces boilerplate code by eliminating the need for 'break' statements.
+
+ // Output the feedback result
+ Console.WriteLine(feedback);
+ Console.WriteLine("\nGrade evaluation complete. Remember, each grade is a step on your learning journey!");
+
+ // Summary of switch-case control flow in this example:
+ // 1. The program evaluates 'grade' against each case (A, B, C, D, F).
+ // 2. If a match is found, the code for that case executes, and the program exits the switch.
+ // 3. If no match is found, the default case runs, providing an error message.
+ // 4. This control structure is useful for cleaner code when checking a single variable against known values.
+
+
+ // Best Practices for `switch` Statements:
+
+ // 1. Prefer `switch` Expressions (C# 8+):
+ // - Starting with C# 8, `switch` expressions provide a concise way to handle multiple conditions in a single expression.
+ // - This can simplify code and improve readability.
+
+ // 2. Use `default` for Unhandled Cases:
+ // - Always include a `default` case to handle unexpected values, even if it’s just to log or throw an exception.
+ // - This ensures code is safe and handles cases not covered by specific `case` labels.
+
+ // 3. Group Cases with Similar Logic:
+ // - If multiple cases have the same logic, you can group them without duplicating code.
+ // Example:
+ //switch (dayOfWeek)
+ //{
+ // case "Saturday":
+ // case "Sunday":
+ // Console.WriteLine("Weekend");
+ // break;
+ // default:
+ // Console.WriteLine("Weekday");
+ // break;
+ //}
+
+ // 4. Avoid Complex Logic in `switch` Statements:
+ // - Use `switch` primarily for simple value comparisons.
+ // - For complex logic or multiple conditions, consider using `if-else` statements for better control and readability.
+
+ }
+}
\ No newline at end of file
diff --git a/C# Language Features/Control Flow Statements/Switch/Switch.csproj b/C# Language Features/Control Flow Statements/Switch/Switch.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/Switch/Switch.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C# Language Features/Control Flow Statements/WhileLoop/Program.cs b/C# Language Features/Control Flow Statements/WhileLoop/Program.cs
new file mode 100644
index 0000000..8febc22
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/WhileLoop/Program.cs
@@ -0,0 +1,75 @@
+namespace WhileLoopExample;
+
+class Program
+{
+ ///
+ /// Main entry point of the application, demonstrating the use of a `while` loop
+ /// by implementing a countdown from a specified start number down to zero.
+ ///
+ static void Main(string[] args)
+ {
+ // Define the starting number for the countdown.
+ int startNumber = 10;
+ Console.WriteLine($"Starting countdown from {startNumber}...\n");
+
+ // while loop structure:
+ // The while loop repeatedly executes a block of code as long as a specified condition remains true.
+ // It is particularly useful when the number of iterations is not known in advance, and we want to
+ // keep running until a specific condition is met.
+ //
+ // Syntax:
+ // while (condition)
+ // {
+ // // Code to execute as long as condition is true
+ // }
+
+ // In this case, the condition is startNumber >= 0, which will allow the countdown to continue until
+ // startNumber is less than zero.
+
+ // Begin while loop for countdown.
+ while (startNumber >= 0)
+ {
+ // Print the current number in the countdown.
+ Console.WriteLine($"Countdown: {startNumber}");
+
+ // Decrement startNumber by 1 to move towards ending the loop.
+ startNumber--;
+
+ // Important Note:
+ // - The decrement operation (startNumber--) is critical because it moves startNumber closer
+ // to the condition that ends the loop (startNumber < 0).
+ // - Without this, the loop would continue infinitely since startNumber would always be >= 0.
+ }
+
+ // Once the loop exits, print a final message to indicate the end of the countdown.
+ Console.WriteLine("\nCountdown complete!");
+
+ // Explanation of the while loop in this example:
+ // 1. Before each iteration, the condition (startNumber >= 0) is checked.
+ // 2. If the condition is true, the loop executes the code block.
+ // 3. After each iteration, startNumber is decreased by 1 (startNumber--).
+ // 4. The loop stops when startNumber is less than 0, meaning the countdown is finished.
+
+ // Key Advantages of a while loop:
+ // - Useful when the number of iterations is not predetermined.
+ // - Continues as long as the condition is true, making it ideal for scenarios where the end condition
+ // is determined dynamically within the loop.
+
+
+ // Best Practices for `while` Loops:
+
+ // 1. Use `while` for Unknown or Dynamic Iteration Counts:
+ // - Use a `while` loop when the number of iterations is not known in advance and depends on conditions within the loop.
+ // - Avoid using it if a set iteration count can be determined, as a `for` loop may be more appropriate.
+
+ // 2. Always Ensure the Loop Condition Can Become False:
+ // - To avoid infinite loops, ensure that the condition can eventually be met by modifying a variable or state inside the loop.
+
+ // 3. Avoid Complex Conditions:
+ // - Complex conditions can make `while` loops hard to read. Break down complicated logic into helper functions if needed.
+
+ // 4. Minimize Operations Inside the Condition:
+ // - Avoid performing unnecessary operations within the `while` condition to prevent excessive processing.
+
+ }
+}
\ No newline at end of file
diff --git a/C# Language Features/Control Flow Statements/WhileLoop/WhileLoop.csproj b/C# Language Features/Control Flow Statements/WhileLoop/WhileLoop.csproj
new file mode 100644
index 0000000..2150e37
--- /dev/null
+++ b/C# Language Features/Control Flow Statements/WhileLoop/WhileLoop.csproj
@@ -0,0 +1,10 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
diff --git a/C# Language Features/Readme.md b/C# Language Features/Readme.md
deleted file mode 100644
index 7ef321d..0000000
--- a/C# Language Features/Readme.md
+++ /dev/null
@@ -1,117 +0,0 @@
-# C# Language Features To-Do List
-
-## 1. **Basic Syntax, Data Types, and Control Flow**
-- [ ] Variables and Data Types
- - [ ] int, float, double, char, bool, string
- - [ ] var and dynamic
-- [ ] Constants and Enumerations
- - [ ] const vs readonly
- - [ ] Enums
-- [ ] Control Flow Statements
- - [ ] if, else, else if
- - [ ] switch statements
- - [ ] for, while, and do-while loops
- - [ ] foreach loops
-- [ ] Exception Handling
- - [ ] try, catch, finally
- - [ ] throw
- - [ ] Custom exceptions
-- [ ] Namespaces and Using Directives
-- [ ] Functions and Methods
- - [ ] Method overloading
- - [ ] Named and optional parameters
- - [ ] Recursion
- - [ ] Local functions (C# 7.0+)
-
-## 2. **Object-Oriented Programming (OOP)**
-- [ ] Classes and Objects
- - [ ] Fields, Properties, and Methods
- - [ ] Constructors and Destructors
- - [ ] Static members
- - [ ] Partial classes
-- [ ] Inheritance and Polymorphism
- - [ ] Base and derived classes
- - [ ] Virtual methods and overriding
- - [ ] Abstract classes and methods
- - [ ] Sealed classes and methods
-- [ ] Interfaces
- - [ ] Implementing interfaces
- - [ ] Default interface methods (C# 8.0+)
-- [ ] Encapsulation
- - [ ] Access modifiers (public, private, protected, internal)
- - [ ] Properties with getters and setters
-- [ ] Delegates and Events
- - [ ] Multicast delegates
- - [ ] Anonymous methods
- - [ ] Events
- - [ ] Func, Action, and Predicate delegates
-- [ ] Operator Overloading
-
-## 3. **Advanced C# Features**
-- [ ] Collections and Generics
- - [ ] List, Dictionary, Queue, Stack, and more
- - [ ] Generic classes, methods, and interfaces
- - [ ] Covariance and Contravariance
-- [ ] LINQ (Language Integrated Query)
- - [ ] Basic LINQ queries
- - [ ] Lambda expressions
- - [ ] Deferred execution
- - [ ] LINQ to Objects, LINQ to XML, LINQ to SQL
-- [ ] Anonymous Types and Tuples
- - [ ] Creating and using anonymous types
- - [ ] Tuples and Deconstruction (C# 7.0+)
-- [ ] Async and Await
- - [ ] Asynchronous methods
- - [ ] Task, ValueTask, and Task.Run
- - [ ] Exception handling in async methods
- - [ ] Cancellation tokens
-- [ ] Dynamic Types (dynamic keyword)
-
-## 4. **Memory Management and Performance**
-- [ ] Value Types vs Reference Types
-- [ ] Garbage Collection
-- [ ] Boxing and Unboxing
-- [ ] Stack vs Heap
-- [ ] Span and Memory (C# 7.2+)
-- [ ] Ref Returns and Locals (C# 7.0+)
-- [ ] Performance improvements with ValueTask
-
-## 5. **New Language Features (C# 8.0, 9.0, 10.0, 11.0, 12.0)**
-- [ ] Nullable Reference Types (C# 8.0)
-- [ ] Pattern Matching
- - [ ] Type patterns
- - [ ] Switch expressions (C# 8.0+)
- - [ ] Positional patterns, Property patterns (C# 9.0+)
- - [ ] Relational and Logical patterns (C# 9.0+)
-- [ ] Records (C# 9.0)
- - [ ] Immutable data types
- - [ ] Positional records
-- [ ] Init-Only Setters (C# 9.0)
-- [ ] Top-Level Programs (C# 9.0)
-- [ ] Target-Typed new Expressions (C# 9.0)
-- [ ] File-Scoped Namespaces (C# 10.0)
-- [ ] Global Using Directives (C# 10.0)
-- [ ] Interpolated String Handlers (C# 10.0)
-- [ ] Record Structs (C# 10.0)
-- [ ] Raw String Literals (C# 11.0)
-- [ ] Required Members (C# 11.0)
-- [ ] List Patterns (C# 12.0)
-- [ ] Primary Constructors (C# 12.0)
-- [ ] Default Interface Implementations (C# 8.0+)
-- [ ] Extended property patterns (C# 12.0)
-
-## 6. **Miscellaneous**
-- [ ] Extension Methods
-- [ ] Indexers and Iterators
-- [ ] Attributes
- - [ ] Custom attributes
- - [ ] Reflection and Metadata
-- [ ] Multithreading and Parallel Programming
- - [ ] Task Parallel Library (TPL)
- - [ ] Parallel.For and Parallel.Foreach
- - [ ] Thread safety and locking mechanisms
- - [ ] Asynchronous streams (IAsyncEnumerable)
-- [ ] File I/O
- - [ ] Reading and writing files
- - [ ] Stream handling
- - [ ] JSON and XML serialization
diff --git a/dotnetflare.sln b/dotnetflare.sln
index e6b4159..9b9713c 100644
--- a/dotnetflare.sln
+++ b/dotnetflare.sln
@@ -18,6 +18,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStructures.Tests", "Dat
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataStructures.Benchmarks", "Data Structures\DataStructures.Benchmarks\DataStructures.Benchmarks.csproj", "{E44030A8-22A3-415D-8AE7-3E4869A9F77C}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "C# Language Features", "C# Language Features", "{F96777BD-5608-4019-8BD6-27756B15477D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Control Flow Statements", "Control Flow Statements", "{39D801B3-413A-479E-9057-044AE852A8BF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IfElse", "C# Language Features\Control Flow Statements\IfElse\IfElse.csproj", "{9E668CD8-A9D3-42EE-81EE-304ED8D346DF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Switch", "C# Language Features\Control Flow Statements\Switch\Switch.csproj", "{7263C4D9-6109-4826-8E26-6AD5D23FAEF1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ForLoop", "C# Language Features\Control Flow Statements\ForLoop\ForLoop.csproj", "{4D215CB8-BD62-4784-BA49-E1D8FC4E1F49}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoWhile", "C# Language Features\Control Flow Statements\DoWhile\DoWhile.csproj", "{63EACCA5-5FDA-445E-A936-C6C82F3D80B0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WhileLoop", "C# Language Features\Control Flow Statements\WhileLoop\WhileLoop.csproj", "{CD0A3166-AE42-48FC-864E-EC073BD03CB1}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -36,6 +50,26 @@ Global
{E44030A8-22A3-415D-8AE7-3E4869A9F77C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E44030A8-22A3-415D-8AE7-3E4869A9F77C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E44030A8-22A3-415D-8AE7-3E4869A9F77C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9E668CD8-A9D3-42EE-81EE-304ED8D346DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E668CD8-A9D3-42EE-81EE-304ED8D346DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E668CD8-A9D3-42EE-81EE-304ED8D346DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9E668CD8-A9D3-42EE-81EE-304ED8D346DF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7263C4D9-6109-4826-8E26-6AD5D23FAEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7263C4D9-6109-4826-8E26-6AD5D23FAEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7263C4D9-6109-4826-8E26-6AD5D23FAEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7263C4D9-6109-4826-8E26-6AD5D23FAEF1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4D215CB8-BD62-4784-BA49-E1D8FC4E1F49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4D215CB8-BD62-4784-BA49-E1D8FC4E1F49}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4D215CB8-BD62-4784-BA49-E1D8FC4E1F49}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4D215CB8-BD62-4784-BA49-E1D8FC4E1F49}.Release|Any CPU.Build.0 = Release|Any CPU
+ {63EACCA5-5FDA-445E-A936-C6C82F3D80B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {63EACCA5-5FDA-445E-A936-C6C82F3D80B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {63EACCA5-5FDA-445E-A936-C6C82F3D80B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {63EACCA5-5FDA-445E-A936-C6C82F3D80B0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CD0A3166-AE42-48FC-864E-EC073BD03CB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CD0A3166-AE42-48FC-864E-EC073BD03CB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CD0A3166-AE42-48FC-864E-EC073BD03CB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CD0A3166-AE42-48FC-864E-EC073BD03CB1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -44,6 +78,12 @@ Global
{8260D7E2-C57C-45E9-BDE9-4F8704C2DE2A} = {772B271A-781A-4B0F-BA3A-2F15C3BC9C85}
{B072EC3B-3B5F-4F2F-ACD4-BCC52FF2C34D} = {772B271A-781A-4B0F-BA3A-2F15C3BC9C85}
{E44030A8-22A3-415D-8AE7-3E4869A9F77C} = {772B271A-781A-4B0F-BA3A-2F15C3BC9C85}
+ {39D801B3-413A-479E-9057-044AE852A8BF} = {F96777BD-5608-4019-8BD6-27756B15477D}
+ {9E668CD8-A9D3-42EE-81EE-304ED8D346DF} = {39D801B3-413A-479E-9057-044AE852A8BF}
+ {7263C4D9-6109-4826-8E26-6AD5D23FAEF1} = {39D801B3-413A-479E-9057-044AE852A8BF}
+ {4D215CB8-BD62-4784-BA49-E1D8FC4E1F49} = {39D801B3-413A-479E-9057-044AE852A8BF}
+ {63EACCA5-5FDA-445E-A936-C6C82F3D80B0} = {39D801B3-413A-479E-9057-044AE852A8BF}
+ {CD0A3166-AE42-48FC-864E-EC073BD03CB1} = {39D801B3-413A-479E-9057-044AE852A8BF}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {68DB01AB-2BE8-48CA-970A-8BEE26A25651}