public static void Main()
string[] arrayStr={"talor","talorSivan","Talor8","t123","bob43","Tal-or","talor_siv268","sivan987","Ta!or","100200300"};
string newPassword="talor";
Console.WriteLine("the last tan password that was in use: ");
bool result=PasswordCheck(arrayStr,newPassword);
Console.WriteLine("the new password is: "+ newPassword+" and the password has not been used before");
Console.WriteLine("the new password is: "+ newPassword+" and the password was used before");
Console.WriteLine("The ten passwords after: ");
string[] arrayStr2={"talor","talorSivan","Talor8","t123","bob43","Tal-or","talor_siv268","sivan987","Ta!or","100200300"};
newPassword="talorNewPass";
Console.WriteLine("\n\nthe last tan password that was in use: ");
result=PasswordCheck(arrayStr2,newPassword);
Console.WriteLine("the new password is: "+ newPassword+" and the password has not been used before");
Console.WriteLine("the new password is: "+ newPassword+" and the password was used before");
Console.WriteLine("The ten passwords after: ");
public static void PrintArray<T>(T[] array){
int arrayLen= array.Length;
for(int i=0; i<arrayLen; i++){
public static bool PasswordCheck(string[] arrayStr, string newPassword){
for(int i=0; i<arrayStr.Length;i++){
if(arrayStr[i]==newPassword){
for(int i= arrayStr.Length-1;i>0;i--){
arrayStr[i] = arrayStr[i-1];
arrayStr[0] = newPassword;