Create C# methods with parameters

Beginner
Developer
Higher Education Educator
K-12 Educator
Student
.NET
Visual Studio Code

Learn how to use different types of input parameters in methods

Learning objectives

  • Learn more about using parameters

  • Understand method scope

  • Understand pass-by-reference and pass-by-value parameter types

  • Learn how to use optional and named arguments

Prerequisites

  • Experience using C# data types including int, string, arrays, and 2D arrays

  • Experience using switch statements, if-else statements, and for-loops

  • Experience using the Random class to generate a random number.

  • Basic understanding of C# methods