You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-language/guided-project-arrays-iteration-selection/includes/3-exercise-create-arrays-foreach-loops.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
In this exercise, you'll review the Starter project code and then begin updating the application. Your first coding task will be creating the arrays that hold student exam scores. Once your application data is available in arrays, you'll begin working on a `foreach` loop that can be used to sum student grades. The detailed tasks that you'll complete during this exercise are:
1
+
In this exercise, you review the Starter project code and then begin updating the application. Your first coding task is creating the arrays that hold student exam scores. Once your application data is available in arrays, you begin working on a `foreach` loop that can be used to sum student grades. The detailed tasks that you complete during this exercise are:
2
2
3
3
1. Code review: review the contents of the Program.cs file.
4
4
@@ -15,15 +15,15 @@ In this exercise, you'll review the Starter project code and then begin updating
15
15
16
16
## Review the contents of the Program.cs file
17
17
18
-
In this task, you'll review the code that's provided as a Starter project for this module. The Program.cs file contains the initial version of the student grading application that you'll be updating.
18
+
In this task, you review the code that's provided as a Starter project for this module. The Program.cs file contains the initial version of the student grading application that you are updating.
19
19
20
20
1. Ensure that you have the **GuidedProject** folder open in Visual Studio Code.
21
21
22
22
The Prepare unit (the previous unit in this module) includes a Setup section for this Guided project module. The Setup section describes the process for downloading your initial code and opening the project folder Visual Studio Code. If necessary, go back and follow the Setup instructions.
23
23
24
24
1. In the Visual Studio Code EXPLORER view, expand the **Starter** folder, then select **Program.cs**.
25
25
26
-
When you select the Program.cs file, the file contents will open in the main Editor area to the right of the EXPLORER view.
26
+
When you select the Program.cs file, the file contents open in the main Editor area to the right of the EXPLORER view.
27
27
28
28
If the EXPLORER view isn't open, you can open it using the Activity Bar on the far-left side of the Visual Studio Code window. The EXPLORER button is the topmost icon on the Activity Bar.
29
29
@@ -119,14 +119,14 @@ In this task, you'll review the code that's provided as a Starter project for th
119
119
120
120
Thissectionprintstheformattedoutputinaccordancewiththeteacher's guidelines. The first line is a header line with column titles, followed by the names and scores for each student.
121
121
122
-
The `Console.ReadLine()` statementwillpausetheapplicationsothattheapplicationusercanreviewtheoutput.
122
+
The `Console.ReadLine()` statementpausestheapplicationsothattheapplicationusercanreviewtheoutput.
Copy file name to clipboardExpand all lines: learn-pr/wwl-language/guided-project-arrays-iteration-selection/includes/4-exercise-construct-nested-loops.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
In this exercise, you'll add a string array to hold the student names, and then implement a nested `foreach` structure that iterates through the student names in an outer loop and student scores in the inner loop. You'll begin by constructing the `studentNames` array and a `foreach` loop that iterates through the array elements. Next, you'll move the code that's used to calculate Sophia's grades into the code block of the "names" loop. Finally, you'll implement the code logic that uses the student's name to access their scores array, calculate their average score, and write their grade to the console. The detailed tasks that you'll complete during this exercise are:
1
+
In this exercise, you add a string array to hold the student names, and then implement a nested `foreach` structure that iterates through the student names in an outer loop and student scores in the inner loop. You begin by constructing the `studentNames` array and a `foreach` loop that iterates through the array elements. Next, you move the code that's used to calculate Sophia's grades into the code block of the "names" loop. Finally, you implement the code logic that uses the student's name to access their scores array, calculate their average score, and write their grade to the console. The detailed tasks that you complete during this exercise are:
2
2
3
3
1. Create names array: Create a student names array.
4
4
@@ -83,7 +83,7 @@ In this task, you'll create a student names array and a `foreach` loop that iter
83
83
84
84
1. At the Terminal command prompt, type **dotnet build** and then press Enter.
85
85
86
-
The `dotnet build` command instructs the compiler to build the application. If any errors are detected, they will be reported.
86
+
The `dotnet build` command instructs the compiler to build the application. If any errors are detected, they'll be reported.
87
87
88
88
1. If you see Error or Warning messages, you need to fix them before continuing.
89
89
@@ -185,7 +185,7 @@ In this task, you'll relocate the code that calculates and reports Sophia's scor
185
185
Console.ReadLine();
186
186
```
187
187
188
-
Noticethatatthispoint, yourcodewillcalculateandreportSophia's score regardless of the `name` of the current student. You will address that shortly.
188
+
Noticethatatthispoint, yourcodewillcalculateandreportSophia's score regardless of the `name` of the current student. You'lladdressthatshortly.
189
189
190
190
1. Deletethefollowingcode:
191
191
@@ -264,7 +264,7 @@ In this task, you'll relocate the code that calculates and reports Sophia's scor
264
264
265
265
1. At the Terminal command prompt, type **dotnet build** and then press Enter.
266
266
267
-
The `dotnet build` command instructs the compiler to build the application. If any errors are detected, they will be reported.
267
+
The `dotnet build` command instructs the compiler to build the application. If any errors are detected, they'll be reported.
268
268
269
269
1. If you see Error or Warning messages, you need to fix them before continuing.
270
270
@@ -503,7 +503,7 @@ In this task, you'll update the code that performs student score calculations us
Noticethatthiscodehasreplacedthelettergradeassignmentwitha"?". You'll work on automating the assignment of letter grades in the next exercise.
507
507
508
508
1. Movethe `Console.WriteLine` statementthat's used to write the column labels of your score report to the location just above the outer `foreach` loop.
509
509
@@ -598,4 +598,4 @@ In this task, you'll run the application to verify that your code logic is worki
598
598
599
599
1. ClosetheTerminalpanel.
600
600
601
-
Congratulations, yourapplicationhascomealongwayfromwhereyoustartedout. Youaremakingefficientuseofarraysand `foreach` iterations, and you've integrated an `if` statement that enables your code to select the correct scores array.
601
+
Congratulations, yourapplicationhascomealongwayfromwhereyoustartedout. You're making efficient use of arrays and `foreach` iterations, and you'veintegratedan `if` statementthatenablesyourcodetoselectthecorrectscoresarray.
Copy file name to clipboardExpand all lines: learn-pr/wwl-language/guided-project-arrays-iteration-selection/includes/5-exercise-implement-selection-statements.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
-
In this exercise, you'll develop the code that automatically assigns a student's letter grade based on their final numeric score and you'll update the application so that extra credit project scores are factored into the student's final grade. You will begin by writing an `if-elseif-else` construct that can be used to evaluate the student's numeric score and assign the letter grade. Next, you'll examine the application requirements related to extra credit work, and then work your way through the required code updates. The detailed tasks that you'll complete during this exercise are:
1
+
In this exercise, you develop the code that automatically assigns a student's letter grade based on their final numeric score and you update the application so that extra credit project scores are factored into the student's final grade. You begin by writing an `if-elseif-else` construct that can be used to evaluate the student's numeric score and assign the letter grade. Next, you examine the application requirements related to extra credit work, and then work your way through the required code updates. The detailed tasks that you complete during this exercise are:
2
2
3
3
1. Develop an `if-elseif-else` construct that evaluates the student's score to assign a letter grade. The expression that's evaluated compares the student's numeric score with a range of scores taken from a grading chart provided by the teacher.
4
4
5
-
1. Integrate extra credit scores into each student's scores array, and then update the code that's used to calculate the student's numeric score. The `foreach` that's used to sum the student scores will be updated to include an `if` statement that branches the code. The exam scores will be applied to the sum in one branch, and the extra credit scores in the other branch.
5
+
1. Integrate extra credit scores into each student's scores array, and then update the code that's used to calculate the student's numeric score. The `foreach` that's used to sum the student scores will be updated to include an `if` statement that branches the code. The exam scores are applied to the sum in one branch, and the extra credit scores in the other branch.
6
6
7
7
> [!IMPORTANT]
8
8
> You need to have completed this module's previous Exercise, "Create arrays and foreach loops", before you begin this Exercise.
9
9
10
10
## Assign letter grades using an `if-elseif-else` construct
11
11
12
-
In this task, you'll develop an `if-elseif-else` structure that can be used to assign letter grades based on a calculated numeric score.
12
+
In this task, you develop an `if-elseif-else` structure that can be used to assign letter grades based on a calculated numeric score.
13
13
14
14
1. Ensure that you have the Program.cs file open in the Visual Studio Code Editor.
15
15
@@ -43,7 +43,7 @@ In this task, you'll develop an `if-elseif-else` structure that can be used to a
43
43
0-59F
44
44
```
45
45
46
-
Noticethatthetoprowofscores, thevaluesgreaterthanorequalto97, havealettergradeof"A+". Inotherwords, ifastudent's final score is >= 97, they'llbeassignedalettergradeof"A+".
46
+
Noticethatthetoprowofscores, thevaluesgreaterthanorequalto97, havealettergradeof"A+". Inotherwords, ifastudent's final score is >= 97, they are assigned a letter grade of "A+".
47
47
48
48
1. Tocreatean `if` statementthatassigns `A+` to `currentStudentLetterGrade` whenthestudent's score is greater than or equal to 97, enter the following code:
0 commit comments