using System; public class Program{ public class BankAccount { private decimal _balance; private string _pin; public BankAccount(decimal initialBalance, string pin) { _balance = initialBalance; _pin = pin; } public void Deposit(decimal amount) { _balance += amount; } public bool Withdraw(decimal amount) { if (amount > _balance) { return false; } _balance -= amount; return true; } public decimal GetBalance() { return _balance; } public bool ChangePin(string oldPin, string newPin) { if (_pin != oldPin) { return false; } _pin = newPin; return true; } } // Main method for testing public static void Main(string[] args) { BankAccount account = new BankAccount(1000m, "1234"); Console.WriteLine("Initial Balance: " + account.GetBalance()); // Deposit test account.Deposit(500m); Console.WriteLine("After Deposit: " + account.GetBalance()); // Withdraw test bool withdrawSuccess = account.Withdraw(300m); Console.WriteLine("Withdraw 300 Successful: " + withdrawSuccess); Console.WriteLine("Balance After Withdrawal: " + account.GetBalance()); // Withdraw exceeding balance bool failedWithdraw = account.Withdraw(2000m); Console.WriteLine("Withdraw 2000 Successful: " + failedWithdraw); Console.WriteLine("Balance After Failed Withdrawal: " + account.GetBalance()); // Change PIN test bool pinChanged = account.ChangePin("1234", "5678"); Console.WriteLine("PIN Changed: " + pinChanged); // Wrong old PIN test bool failedPinChange = account.ChangePin("1111", "9999"); Console.WriteLine("PIN Changed with Wrong Old PIN: " + failedPinChange); } }