/* // Variables int age = 12; int wealth; wealth = 120; // Input / Output Console.Write("Enter Your name: "); string name = Console.ReadLine(); Console.Write("Enter Amount of Cash: "); int money = Convert.ToInt32(Console.ReadLine()); // Conditions and string Templating if (money > 10) { Console.WriteLine($"{name} is allowed in the party."); }else { Console.WriteLine($"{name} is not allowed in the party."); } */ // Arrays [predefined number of items] and Lists [unlimited number of items] // Arrays: /* string[] provinces = new string[5] {"Sindh", "Punjab", "Khyber Pakhtun Khuwa", "Balochistan", "Gilgit"}; Console.WriteLine(provinces[0]); Console.WriteLine(provinces[4]); Console.WriteLine(); provinces[0] = "Gilgit"; provinces[4] = "Sindh"; for(int i = 0; i < 5; i++) { Console.Write($"{i}.{provinces[i]}, "); } Console.WriteLine(); for(int i = 0; i < provinces.Length; i++) { Console.Write($"{i}.{provinces[i]}, "); } Console.WriteLine(); foreach(string province in provinces) { Console.Write($"{province}, "); } Console.WriteLine(); */ // Lists: /* List<string> friends = new List<string>() {"Azir"}; Console.Write("to add a friend type f, to view all friends type v, press any other key to exit: "); string command = Console.ReadLine(); if(command == "v" || command == "V") { Console.WriteLine("Viewing Friends"); }else if(command == "f" || command == "F") { Console.Write("Enter Friend Name: "); friends.Add(Console.ReadLine()); }else { Console.WriteLine("Exiting..."); } */ // Function: A block of code /* void CreateFriends() { Console.WriteLine("I am your friend"); Console.WriteLine("Please Talk To Me!"); Console.Write("What is Your Name: "); string name = Console.ReadLine(); Console.WriteLine($"Good to meet you {name}"); } int multiply(int number1, int number2) { return number1 * number2; } int luckyNumber() { return 7; } string increaseBy2(int num) { Console.WriteLine($"{num} + 2 = {num + 2}"); return "Azir"; } Console.WriteLine(increaseBy2(10)); */ // Loops: For repeating commands, foreach, while // Reusing with list example /* List<string> friends = new List<string>() {"Azir"}; bool shouldContinue = true; while(shouldContinue) { Console.Write("to add a friend type f, to view all friends type v, press any other key to exit: "); string command = Console.ReadLine(); if(command == "v" || command == "V") { Console.Write("Friends: "); foreach(string friendName in friends) { Console.Write($"{friendName}, "); } Console.Write("n"); }else if(command == "f" || command == "F") { Console.Write("Enter Friend Name: "); friends.Add(Console.ReadLine()); }else { Console.WriteLine("Exiting..."); shouldContinue = false; } } */ // Loops: for /* for(int i = 0; i < 10; i++) { Console.WriteLine($"{i} -> Hi"); } */