Introduction to Methods

Introduction to Methods: Introduction to Methods: an overview, Practice: The Need for Methods, Organizing Code into Methods, Practice: Creating Methods.

Updated

  1. 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 (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 (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 (Apprentice): Replace the football program's copied blocks with one method that takes each team's scores as parameters.