I'm trying to create a console application for basic banking functions. I understand how the random number generator works, but I need to set up an array so that the random numbers don't repeat, considering that the random number that is generated represents the users personalized PIN number. How would I implement this into my current code?
class BankAccount
{
    private string firstName;
    private string lastName;
    private int accountNumber;
    private decimal balance;
    static public int customers = 0;
    private int pinNumber;
    public decimal Balance
    {
        get
        {
            return balance;
        }
        set
        {
            if (value >= 0)
                balance = value;
            else
            {
                Console.WriteLine("There will be an overdraft fee of $10.00.");
                balance = value - 10;
            }
        }
    }
    public string FirstName
    {
        get
        {
            return firstName;
        }
    }
    public string LastName
    {
        get
        {
            return lastName;
        }
    }
    public int AccountNumber
    {
        get
        {
            return accountNumber;
        }
    }
    public int PinNumber
    {
        get
        {
            return pinNumber;
        }
    }
    public BankAccount(string firstNameValue, string lastNameValue)
    {
        firstName = firstNameValue;
        lastName = lastNameValue;
        accountNumber = customers + 1;
        Random pin = new Random();
        pinNumber = pin.Next(1111, 9999);
        Balance = 0;
        customers++;
    }
    public BankAccount()
    {
        Balance = 0;
        customers++;
    }
    public void Credit(decimal amount)
    {
        Balance = Balance + amount;
    }
    public void Debit(decimal amount)
    {
        if (amount > Balance)
            Console.WriteLine("Debit amount exceeded account balance.");
        Balance = Balance - amount;
    }
    public static decimal AverageBalance(BankAccount[] accounts)
    {
        int count = 0;
        decimal total = 0;
        for (int i = 0; i < accounts.Length; i++)
        {
            if (accounts[i] != null)
            {
                total += accounts[i].Balance;
                count++;
            }
        }
        return total / count;
    }
}
 
     
     
     
     
     
    