# Methods and Conditions

Methods let you name a piece of work and reuse it instead of repeating code, and conditions let your program make decisions. You will organize code into methods with parameters and return values, then branch with if, else, switch, and switch expressions.

Updated: November 3, 2026

## [Introduction to Methods](https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/introduction-to-methods)

1. [Introduction to Methods: an overview](https://www.ask-codey.com/lessons/introduction-to-methods-an-overview) (Novice): A method is a named block of reusable code; you've been calling them since your first program.
2. [Practice: The Need for Methods](https://www.ask-codey.com/lessons/introduction-to-methods-practice-the-need-for-methods) (Novice): Extend a program that prints college football scores by copying and pasting its code, and see the problems copying causes.
3. [Organizing Code into Methods](https://www.ask-codey.com/lessons/introduction-to-methods-organizing-code-into-methods) (Apprentice): Write your own C# methods with parameters and return values, call them with arguments, and keep each one to a single job.
4. [Practice: Creating Methods](https://www.ask-codey.com/lessons/introduction-to-methods-practice-creating-methods) (Apprentice): Replace the football program's copied blocks with one method that takes each team's scores as parameters.

## [Conditional Logic in C#](https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/conditional-logic-in-csharp)

1. [If](https://www.ask-codey.com/lessons/conditional-logic-in-csharp-if) (Novice): Run code only when a condition is true, with if, if-else and else if, and write conditions with C#'s comparison operators.
2. [Multiple Conditions](https://www.ask-codey.com/lessons/conditional-logic-in-csharp-multiple-conditions) (Apprentice): Combine conditions with && (and), || (or) and ! (not), and group them with parentheses so they mean what you intend.
3. [Switch](https://www.ask-codey.com/lessons/conditional-logic-in-csharp-switch) (Apprentice): Pick one of many blocks of code by the value of a single variable with C#'s switch statement, including shared cases and a default.
4. [Switch Expressions and the Conditional Operator](https://www.ask-codey.com/lessons/conditional-logic-in-csharp-switch-expressions) (Apprentice): Choose a value, rather than run a block, with C#'s conditional operator for two choices and a switch expression for many.

## [Exercise: Methods and Conditions](https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/topics/csharp-exercise-methods-and-conditions)

1. [Exercise: Methods and Conditions](https://www.ask-codey.com/lessons/exercise-methods-and-conditions) (Apprentice): Write 13 methods for three small businesses, using parameters, return values and conditions, and check each one with tests.

Source: https://www.ask-codey.com/courses/csharp-full-stack-bootcamp/chapters/methods-and-conditions
