Skip to content

Commit acaba02

Browse files
authored
Merge pull request #50953 from wwlpublish/05e0975cc3477f6ca0593371017d0bdaf27970d21b5481dd92903e5fb804cad9-live
Modules/M04-store-iterate-through-data-sequences-using-arrays-foreach-statement-c-sharp
2 parents f4a3f94 + 45d7e48 commit acaba02

13 files changed

+49
-26
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48643,6 +48643,16 @@
4864348643
"source_path": "learn-pr/wwl-language/csharp-readable-code/6-solution.md",
4864448644
"redirect_url": "/training/modules/csharp-readable-code/6-review-solution-code-readability-challenge",
4864548645
"redirect_document_id": false
48646+
},
48647+
{
48648+
"source_path": "learn-pr/wwl-language/csharp-arrays/4-challenge.md",
48649+
"redirect_url": "/training/modules/csharp-arrays/4-exercise-challenge-nested-iteration",
48650+
"redirect_document_id": false
48651+
},
48652+
{
48653+
"source_path": "learn-pr/wwl-language/csharp-arrays/5-solution.md",
48654+
"redirect_url": "/training/modules/csharp-arrays/5-review-solution-nested-iteration-challenge",
48655+
"redirect_document_id": false
4864648656
}
4864748657
]
4864848658
}

learn-pr/wwl-language/csharp-arrays/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: 08/09/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-arrays/2-exercise-array-basics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Get started with array basics
44
metadata:
55
title: Exercise - Get started with array basics
66
description: "Exercise - Get started with array basics"
7-
ms.date: 08/09/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-arrays/3-exercise-foreach.yml

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

learn-pr/wwl-language/csharp-arrays/4-challenge.yml renamed to learn-pr/wwl-language/csharp-arrays/4-exercise-challenge-nested-iteration.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 for nested iteration and selecti
44
metadata:
55
title: Exercise - Complete a challenge activity for nested iteration and selection statements
66
description: "Exercise - Complete a challenge activity for nested iteration and selection statements"
7-
ms.date: 08/09/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: 9
1414
content: |
15-
[!include[](includes/4-challenge.md)]
15+
[!include[](includes/4-exercise-challenge-nested-iteration.md)]

learn-pr/wwl-language/csharp-arrays/5-solution.yml renamed to learn-pr/wwl-language/csharp-arrays/5-review-solution-nested-iteration-challenge.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ title: Review the solution for the nested iteration and selection statements cha
44
metadata:
55
title: Review the solution for the nested iteration and selection statements challenge activity
66
description: "Review the solution for the nested iteration and selection statements challenge activity"
7-
ms.date: 08/09/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-nested-iteration-challenge.md)]

learn-pr/wwl-language/csharp-arrays/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: 08/09/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-arrays/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: 08/09/2024
7+
ms.date: 06/16/2025
88
author: wwlpublish
99
ms.author: cahowd
1010
ms.topic: unit

learn-pr/wwl-language/csharp-arrays/includes/2-exercise-array-basics.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2+
3+
14
Arrays can be used to store multiple values of the same type in a single variable. The values stored in an array are generally related. For example, a list of student names could be stored in a string array named `students`.
25

36
Your work in the security department is focused on finding a pattern for fraudulent orders. You want your code to review past customer orders and identify markers associated with fraudulent orders. Your company hopes the markers can be used to identify potential fraudulent purchase orders in the future before they're processed. Since you don't always know in advance how many orders you need to review, you can't create individual variables to hold each Order ID. How can you create a data structure to hold multiple related values?
@@ -34,26 +37,36 @@ This module includes activities that guide you through the process of building a
3437

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

37-
```dos
40+
```PowerShell
3841
C:\Users\someuser\Desktop>
3942
```
4043
4144
> [!NOTE]
4245
> 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.
4346
44-
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.
47+
1. At the Terminal command prompt, to create a new console application in a specified folder, enter the following prompt:
48+
49+
```dotnetcli
50+
dotnet new console -o ./CsharpProjects/TestProject
51+
```
4552
46-
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.
53+
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.
4754
48-
1. In the EXPLORER panel, expand the **CsharpProjects** folder.
55+
If a message is displayed telling you that the files already exist, continue with the next steps. You'll reuse the existing project files.
56+
57+
1. In the EXPLORER view, expand the **CsharpProjects** folder.
58+
59+
You should see the **TestProject** folder and two files, a C# program file named Program.cs and a C# project file named TestProject.csproj.
60+
61+
1. On the Visual Studio Code **File** menu, select **Open Folder**.
4962
50-
You should see the **TestProject** folder and two files, a C# program file named **Program.cs** and a C# project file named **TestProject.csproj**.
63+
1. In the **Open Folder** dialog, select the **CsharpProjects** folder, and then select **Select Folder**.
5164
52-
1. In the EXPLORER panel, to view your code file in the Editor panel, select **Program.cs**.
65+
1. In the EXPLORER view, expand the TestProject folder, and then select **Program.cs**.
5366
5467
1. Delete the existing code lines.
5568
56-
You can use this C# console project to create, build, and run code samples during this module.
69+
You'll be using this C# console project to create, build, and run code samples during this module.
5770
5871
1. Close the Terminal panel.
5972
@@ -121,7 +134,7 @@ To intentionally "break" your application, attempt to access a fourth element of
121134
122135
1. On the Visual Studio Code **File** menu, select **Save**.
123136
124-
1. In the EXPLORER panel, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
137+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
125138
126139
A Terminal panel should open, and should include a command prompt showing that the Terminal is open to your **TestProject** folder location.
127140
@@ -178,7 +191,7 @@ Accessing the value of an array element works the same way as assigning a value
178191
179192
1. On the Visual Studio Code **File** menu, select **Save**.
180193
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**.
194+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
182195
183196
1. At the Terminal command prompt, type `dotnet run` and then press Enter.
184197
@@ -223,7 +236,7 @@ The elements of an array are just like any other variable value. You can assign,
223236
224237
1. On the Visual Studio Code **File** menu, select **Save**.
225238
226-
1. In the EXPLORER panel, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
239+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
227240
228241
1. At the Terminal command prompt, type `dotnet run` and then press Enter.
229242
@@ -292,7 +305,7 @@ You can initialize an array during declaration just like you would a regular var
292305
293306
1. On the Visual Studio Code **File** menu, select **Save**.
294307
295-
1. In the EXPLORER panel, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
308+
1. In the EXPLORER view, to open a Terminal at your TestProject folder location, right-click **TestProject**, and then select **Open in Integrated Terminal**.
296309
297310
1. At the Terminal command prompt, type `dotnet run` and then press Enter.
298311

learn-pr/wwl-language/csharp-arrays/includes/3-exercise-foreach.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Use the `foreach` statement to create a sum of all the items on hand in each bin
3636

3737
1. Use the Open Folder dialog to navigate to, and then open, the **CsharpProjects** folder.
3838

39-
1. In the Visual Studio Code EXPLORER panel, select **Program.cs**.
39+
1. In the Visual Studio Code EXPLORER view, select **Program.cs**.
4040

4141
1. On the Visual Studio Code **Selection** menu, select **Select All**, and then press the Delete key.
4242

@@ -126,7 +126,7 @@ Use the `foreach` statement to create a sum of all the items on hand in each bin
126126

127127
1. On the Visual Studio Code **File** menu, click **Save**.
128128

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

131131
1. At the Terminal command prompt, type **dotnet run** and then press Enter.
132132

0 commit comments

Comments
 (0)