Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Microsoft

Create methods in C# console applications (Get started with C#, Part 5)

Microsoft via Microsoft Learn

Overview

  • Module 1: This module covers the syntax of creating and executing methods. Creating reusable code and structuring solutions using methods are reviewed.
    • Create your first c sharp method
    • Identify parts of code that can be modularized
    • Use methods to organize code into specific tasks
  • Module 2: This module covers method parameters, including pass-by-reference and pass-by-value parameter types. This module also covers optional and named arguments.
    • 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
  • Module 3: This module covers the return keyword and returning values from methods.
    • Understand return types
    • Learn more about the return keyword
    • Learn more about capturing method return values
  • Module 4: Create an application that coordinates school visits to a petting zoo. This project requires the use of different methods with return types and parameters to complete the code.
    • Plan design details with pseudo-code
    • Use methods to perform specific tasks
    • Create methods that accept require and optional parameters
    • Use values returned from methods
  • Module 5: Use methods with parameters and return values to develop the features of a console mini-game.
    • Use Visual Studio Code to develop a C# console application that uses methods to implement logical workflows.
    • Understand existing code and make informed changes to design.
    • Create return values as well as required and optional parameters in methods.

Syllabus

  • Module 1: Module 1: Write your first C# method
    • Introduction
    • Understand the syntax of methods
    • Exercise - Create your first method
    • Exercise - Create reusable methods
    • Exercise - Build code with methods
    • Exercise - Complete the challenge to create a reusable method
    • Review the solution to create a reusable method
    • Knowledge check
    • Summary
  • Module 2: Module 2: Create C# methods with parameters
    • Introduction
    • Exercise - Use parameters in methods
    • Exercise - Understand method scope
    • Exercise - Use value and reference type parameters
    • Exercise - Methods with optional parameters
    • Exercise - Complete the challenge to display email addresses
    • Review the solution to display email addresses
    • Knowledge check
    • Summary
  • Module 3: Module 3: Create C# methods that return values
    • Introduction
    • Exercise - Understand return type syntax
    • Exercise - Return numbers from methods
    • Exercise - Return strings from methods
    • Exercise - Return Booleans from methods
    • Exercise - Return arrays from methods
    • Exercise - Complete the challenge to add methods to make the game playable
    • Review the solution to add methods to make the game playable
    • Knowledge check
    • Summary
  • Module 4: Module 4: Guided project - Plan a Petting Zoo Visit
    • Introduction
    • Prepare for guided project
    • Exercise - Plan your code using methods
    • Exercise - Create a method to shuffle an array
    • Exercise - Create a method with an optional parameter
    • Exercise - Create a method to display the results
    • Knowledge check
    • Summary
  • Module 5: Module 5: Challenge project - Create a mini-game
    • Introduction
    • Prepare for challenge
    • Exercise - Add code to end the game
    • Exercise - Make the player consume food
    • Exercise - Add code to modify movement
    • Knowledge check
    • Summary

Reviews

Start your review of Create methods in C# console applications (Get started with C#, Part 5)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.