Introduction to Methods
Introduction to Methods: Introduction to Methods: an overview, Practice: The Need for Methods, Organizing Code into Methods, Practice: Creating Methods,…
Updated
- Introduction to Methods: an overview (Novice): A method is a named block of reusable code; you've been calling them since your first program.
- Practice: The Need for Methods (Novice): Plan a program that prints college football scores in pseudo-code, extend it by copying and pasting its code, and see the problems copying causes.
- 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.
- Practice: Creating Methods (Apprentice): Replace the football program's copied blocks with one method that takes each team's scores as parameters.
- Passing Values to a Method: by Value and by Reference (Apprentice): Learn what a method can and can't change in the code that calls it, passing by value, with ref and out, and passing an array.