Introduction

Completed

The C# programming language is supplemented by a large library of functionality that enables you to create applications, access data in files or on the Internet, perform advanced mathematical operations, and much more. Understanding how to navigate this library of functionality is a critical skill that will help you build feature-rich applications more quickly.

Suppose you need to generate a daily report that's based on thousands of data files. To save time, your code uses a random sample of the data files to calculate an approximate result without analyzing all the data files. How can you generate a random number? Is this supported by C#? If so, how can you write code to set the value range for a random number, and then generate and retrieve the result?

In this module, you learn about class libraries, and write code that calls methods in the .NET Class Library. You learn the characteristics of methods, and why methods of the .NET Class Library are designed and implemented differently across the .NET Class Library. Most importantly, you write code that uses the .NET Library methods to achieve a specific programming task. Finally, you'll use built-in tools and online documentation to help you gather information about the methods you want to work with.

By the end of this module, you'll know how to find classes and methods in the .NET Class Library, and how to use them to perform common programming tasks.

Important

This module includes coding activities that require Visual Studio Code. You'll need access to a development environment that has Visual Studio Code installed and configured for C# application development.

Learning Objectives

In this module, you will:

  • Write code that calls methods in the .NET Class Library.
  • Use an instance of .NET Class Library classes to call methods that maintain state.
  • Use Intellisense in Visual Studio Code to learn more about a method, including its overloaded versions, its return value type, and its input parameter data types.
  • Use learn.microsoft.com to research what a method does, its overloaded versions, its return value type, its input parameters and what each parameter represents, and more.

Prerequisites:

  • Experience using Visual Studio Code to create and run C# console applications.
  • Experience using the basic C# data types including int and string.
  • Experience using the Console.WriteLine() method.