Programs become useful when they can make decisions, repeat work, and reuse logic. This module covers the three tools that do that in C#: branching with if/else and switch, looping over data, and packaging code into methods you can call from anywhere.
It starts with if/else statements and while loops, then moves to the more concise switch expressions found in modern C#. From there you'll work with arrays and for/foreach loops to process collections of values, and finish with extension methods, a practical look at how methods are defined, called, and used to add behaviour to types you already have.
Watch the lessons in order, then continue on to Object-Oriented Programming.
Layla Porter introduces conditional logic, running different blocks of code depending on whether a condition is true or false, and then repeats work with a while loop.
Tim Corey rewrites a chain of if-else statements as a switch expression, showing how modern C# gets the same result with cleaner syntax and fewer lines.
Layla Porter explains arrays as fixed-length collections and introduces more looping techniques for working through the data they hold.
Tim Corey defines a method in a static class and calls it as though it belonged to the type it extends, a practical view of how methods are written and called.