diff --git a/main.typ b/main.typ index 3e2344f..c837284 100644 --- a/main.typ +++ b/main.typ @@ -317,7 +317,25 @@ while (shouldQuit) { } } -//TODO: do..while example & foreach example +string correctPin = "1234"; +string enteredPin = ""; + +do { + Console.Write("Please provide your PIN: "); + enteredPin = Console.ReadLine(); + + if (enteredPin != correctPin) { + Console.WriteLine("Incorrect PIN. Try again"); + } +} while (enteredPin != correctPin); + +Console.WriteLine("Correct PIN! Access granted."); + +string[] shoppingList = new string[] { "bread", "chicken", "butter"}; +Console.WriteLine("Your shopping list:"); +foreach (string product in shoppingList) { + Console.WriteLine($"- {product}"); +} ``` ==== Rezultat ==== Wyjaƛnienie