Introduction

Completed

Suppose you work for a sales and marketing department that sends thousands of personalized letters to the company's existing clients who are institutional investors. Your team's job is to promote new financial products to the customer. Each letter you send merges personalized information about the customer. The letter compares the returns of their current portfolios with projected returns using the newest products. How do you merge and format the data correctly?

From a high-level perspective, software developers are concerned with:

  • data input, including data typed in by a user from a keyboard, using their mouse, a device, or by another software system via a network request.
  • data processing, including decision logic, manipulating data, and performing calculations.
  • data output, including presentation to an end user via a command-line message, a window, a web page, or saving the processed data into a file, and sending it to a network service.

To solve business problems in C#, you need to work with different types of data, such as strings and numbers. You also need to perform various operations on the data, such as calculations, comparisons, or conversions. In this module, you output string and numeric data in C# using various formatting options. You also create a receipt mockup and a personalized marketing message using data merging techniques.

Learning objectives

In this module, you will:

  • Merge string templates with variables using composite formatting.
  • Use various format specifiers to properly display percentages, currency, and numbers.
  • Use padding methods to properly align string values.

Prerequisites

  • Introductory experience with creating and initializing variables of type string and decimal
  • Introductory experience with literal values of type string and decimal
  • Introductory experience with Console.WriteLine()
  • Experience using Visual Studio Code to develop, build, and run C# code