+
+```csharp
string[] names = new string[]
-
{
-
-"Harry Potter",
-
-"Luke Skywalker",
-
-"Harley Quinn"
-
+ "Harry Potter",
+ "Luke Skywalker",
+ "Harley Quinn"
};
foreach (string name in names)
-
{
-
-Console.WriteLine(name);
-
+ Console.WriteLine(name);
}
+```
-
-
-# foreach Statement (continued)
-
-However, foreach creates a copy of each element in the object so the element cannot be mutated directly:
+
+
-
-
-Performance-wise, using foreach is also more costly because it uses more memory space
-
----
-
-Instead, create a new list
+
-# Exercise 1: Expanding the Console Application
+
+
-Continue working on the command line application you created in "The Main Loop" exercise. Add a new command "add" which prompts the user to write a note.
+### Note about `foreach`
-After the user has inputted the note, it is saved to a list, and the program returns back to listening to commands.
+* However, `foreach` creates a copy of each element in the object so the element cannot be mutated directly:
+ 
+* Performance-wise, using foreach is also more costly because it uses more memory space
+* If you need to change every element, consider creating a new list instead
-Add another command "list" which prints all the saved notes.
+## Exercise 1: Expanding the Console Application
+
-Add one more command "remove" which prints all the saved notes with the index of the note, and then prompts the user for a number. After entering the number the corresponding note is deleted from the list.
+1) Continue working on the command line application you created in [Lecture 4, Exercise 1: The Main Loop ](4-loops#exercise-1-the-main-loop). Add a new command `add` which prompts the user to write a note.
+2) After the user has inputted the note, save it to a list, and return back to listening to commands.
+3) Add another command `list` which prints all the saved notes.
+4) Add one more command `remove` which prints all the saved notes with the index of the note, and then prompts the user for a number. After entering the number the note with the corresponding index is deleted from the list.
-( __Note__ : you can use int.Parse() -method to parse the user input string to an integer)
+* *__Note__*: you can use the `int.Parse()` method to parse the user input string to an integer
-# Assignments
+## Assignments
[Assignments about this topic can be found here](https://gitea.buutti.com/education/academy-assignments/src/branch/master/C%23%20Basics/5.%20Arrays%20&%20Lists)
diff --git a/imgs/5 Arrays and Lists_2.png b/imgs/5 Arrays and Lists_2.png
deleted file mode 100644
index 46e8df9..0000000
Binary files a/imgs/5 Arrays and Lists_2.png and /dev/null differ