static void Main(string[] args)
string[,] userCredentials = new string[,]
{"user1", "password1", "De Guzman"},
{"user2", "password2", "Dela Cruz"},
{"user3", "password3", "Del Pilar"},
Console.Write("Enter username: ");
string inputUsername = Console.ReadLine();
Console.Write("Enter password: ");
string inputPassword = Console.ReadLine();
string userLastName = "";
bool loginSuccess = false;
for (int i = 0; i < userCredentials.GetLength(0); i++)
if (userCredentials[i, 0] == inputUsername && userCredentials[i, 1] == inputPassword)
userLastName = userCredentials[i, 2];
Console.WriteLine($"Login Successful, Welcome {userLastName}!");
Console.WriteLine("Invalid username or password.");
Console.WriteLine("1. Update Password");
Console.WriteLine("2. Binary Search");
Console.WriteLine("3. Log out");
Console.Write("Enter your choice: ");
string option = Console.ReadLine();
Console.Write("Enter new password: ");
string newPassword = Console.ReadLine();
Console.WriteLine("Password updated!");
for (int j = 0; j < userCredentials.GetLength(0); j++)
if (userCredentials[j, 0] == inputUsername)
userCredentials[j, 1] = newPassword;
Console.Write("Binary Search");
int[] arr = { 25, 31, 82, 57, 15,66,94 };
int index = BinarySearch(arr, target);
Console.WriteLine($"Index of {target} in the array is: {index}");
Console.WriteLine($"{target} not found in the array.");
Console.WriteLine("Logged out");
Console.WriteLine("Invalid option.");
static int BinarySearch(int[] numbers, int target)
int right = numbers.Length - 1;
int mid = left + (right - left) / 2;
if (numbers[mid] == target)
else if (numbers[mid] < target)