Skip to content

Commit ae718fa

Browse files
Merge pull request #50952 from wwlpublish/2840bf925091a5b11e9acc184845cfa6970efffa1989282ad4704050bcc0eb6a-live
Modules/M03-add-decision-logic-to-your-code-using-c-sharp
2 parents ab7a056 + 79c6ef3 commit ae718fa

14 files changed

+43
-21
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48673,6 +48673,16 @@
4867348673
"source_path": "learn-pr/wwl-language/csharp-call-methods/6-solution.md",
4867448674
"redirect_url": "/training/modules/csharp-call-methods/6-review-solution-for-call-method-challenge",
4867548675
"redirect_document_id": false
48676+
},
48677+
{
48678+
"source_path": "learn-pr/wwl-language/csharp-if-elseif-else/4-challenge.md",
48679+
"redirect_url": "/training/modules/csharp-if-elseif-else/4-exercise-challenge-apply-business-rules",
48680+
"redirect_document_id": false
48681+
},
48682+
{
48683+
"source_path": "learn-pr/wwl-language/csharp-if-elseif-else/5-solution.md",
48684+
"redirect_url": "/training/modules/csharp-if-elseif-else/5-review-solution-apply-business-rules-challenge",
48685+
"redirect_document_id": false
4867648686
}
4867748687
]
4867848688
}

learn-pr/wwl-language/csharp-if-elseif-else/1-introduction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Introduction
44
metadata:
55
title: Introduction
66
description: "Introduction"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-if-elseif-else/2-exercise-if.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Create decision logic with if statements
44
metadata:
55
title: Exercise - Create decision logic with if statements
66
description: "Exercise - Create decision logic with if statements"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-if-elseif-else/3-exercise-elseif-else.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Create nested decision logic with if, else if, and else
44
metadata:
55
title: Exercise - Create nested decision logic with if, else if, and else
66
description: "Exercise - Create nested decision logic with if, else if, and else"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-if-elseif-else/4-challenge.yml renamed to learn-pr/wwl-language/csharp-if-elseif-else/4-exercise-challenge-apply-business-rules.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ title: Exercise - Complete a challenge activity to apply business rules
44
metadata:
55
title: Exercise - Complete a challenge activity to apply business rules
66
description: "Exercise - Complete a challenge activity to apply business rules"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit
1111
ms.custom:
1212
- N/A
1313
durationInMinutes: 12
1414
content: |
15-
[!include[](includes/4-challenge.md)]
15+
[!include[](includes/4-exercise-challenge-apply-business-rules.md)]

learn-pr/wwl-language/csharp-if-elseif-else/5-solution.yml renamed to learn-pr/wwl-language/csharp-if-elseif-else/5-review-solution-apply-business-rules-challenge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ title: Review the solution to the apply business rules challenge activity
44
metadata:
55
title: Review the solution to the apply business rules challenge activity
66
description: "Review the solution to the apply business rules challenge activity"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit
1111
ms.custom:
1212
- N/A
1313
durationInMinutes: 3
1414
content: |
15-
[!include[](includes/5-solution.md)]
15+
[!include[](includes/5-review-solution-apply-business-rules-challenge.md)]

learn-pr/wwl-language/csharp-if-elseif-else/6-knowledge-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Module assessment
44
metadata:
55
title: Module assessment
66
description: "Knowledge check"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-if-elseif-else/7-summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Summary
44
metadata:
55
title: Summary
66
description: "Summary"
7-
ms.date: 11/15/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-if-elseif-else/includes/2-exercise-if.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22

33

4+
45
Most applications include a large number of execution paths. For example, an application could implement different execution paths based on which menu option a user selects. Developers refer to the code that implements different execution paths as *code branches*.
56

67
The most widely used code branching statement is the `if` statement. The `if` statement relies on a Boolean expression that is enclosed in a set of parentheses. If the expression is true, the code after the `if` statement is executed. If not, the .NET runtime ignores the code and doesn't execute it.
@@ -40,22 +41,32 @@ This module includes activities that guide you through the process of building a
4041

4142
Notice that a command prompt in the Terminal panel displays the folder path for the current folder. For example:
4243

43-
```dos
44+
```PowerShell
4445
C:\Users\someuser\Desktop>
4546
```
4647
4748
> [!NOTE]
4849
> If you are working on your own PC rather than in a sandbox or hosted environment and you have completed other Microsoft Learn modules in this C# series, you may have already created a project folder for code samples. If that's the case, you can skip over the next step, which is used to create a console app in the TestProject folder.
4950
50-
1. At the Terminal command prompt, to create a new console application in a specified folder, type **dotnet new console -o ./CsharpProjects/TestProject** and then press Enter.
51+
1. At the Terminal command prompt, to create a new console application in a specified folder, enter the following prompt:
52+
53+
```dotnetcli
54+
dotnet new console -o ./CsharpProjects/TestProject
55+
```
5156
5257
This .NET CLI command uses a .NET program template to create a new C# console application project in the specified folder location. The command creates the CsharpProjects and TestProject folders for you, and uses TestProject as the name of your `.csproj` file.
5358
54-
1. In the EXPLORER panel, expand the **CsharpProjects** folder.
59+
If a message is displayed telling you that the files already exist, continue with the next steps. You'll reuse the existing project files.
60+
61+
1. In the EXPLORER view, expand the **CsharpProjects** folder.
62+
63+
You should see the **TestProject** folder and two files, a C# program file named Program.cs and a C# project file named TestProject.csproj.
64+
65+
1. On the Visual Studio Code **File** menu, select **Open Folder**.
5566
56-
You should see the TestProject folder and two files, a C# program file named Program.cs and a C# project file named TestProject.csproj.
67+
1. In the **Open Folder** dialog, select the **CsharpProjects** folder, and then select **Select Folder**.
5768
58-
1. In the EXPLORER panel, to view your code file in the Editor panel, select **Program.cs**.
69+
1. In the EXPLORER view, expand the TestProject folder, and then select **Program.cs**.
5970
6071
1. Delete the existing code lines.
6172
@@ -301,7 +312,7 @@ Next, you can implement the rule: "If all three dice you roll result in the same
301312

302313
```
303314

304-
1. In the EXPLORER panel, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
315+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
305316

306317
A Terminal panel should open, and should include a command prompt showing that the Terminal is open to your TestProject folder location.
307318

learn-pr/wwl-language/csharp-if-elseif-else/includes/3-exercise-elseif-else.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Nesting allows you to place code blocks inside of code blocks. In this case, you
178178

179179
1. On the Visual Studio Code **File** menu, click **Save**.
180180

181-
1. In the EXPLORER panel, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
181+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
182182

183183
A Terminal panel should open, and should include a command prompt showing that the Terminal is open to your TestProject folder location.
184184

@@ -203,7 +203,7 @@ Nesting allows you to place code blocks inside of code blocks. In this case, you
203203

204204
1. On the Visual Studio Code **File** menu, click **Save**.
205205

206-
1. In the EXPLORER panel, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
206+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
207207

208208
1. At the Terminal command prompt, to run your code, type **dotnet run** and then press Enter.
209209

0 commit comments

Comments
 (0)