using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pASS4
{
class Program
{
static void Main(string[] args)
{
string pw;
int convertedPw;
int counter = 0;
int uLetters = 0;
int lLetters = 0;
int numbers = 0;
int symbols = 0;
Begin:
Console.WriteLine("Enter a Password");
pw = Console.ReadLine();
// #### >BEGIN< PROCESSING EACH CHARACTER ####
CharEnumerator charEnum = pw.GetEnumerator();
while (charEnum.MoveNext())
{
convertedPw = Convert.ToInt32(pw[counter]);
if ((convertedPw >= 65) && (convertedPw <= 90))
{
uLetters++;
}
if ((convertedPw >= 97) && (convertedPw <= 122))
{
lLetters++;
}
if ((convertedPw >= 48) && (convertedPw <= 57))
{
numbers++;
}
if ((convertedPw >= 33) && (convertedPw <= 47))
{
symbols++;
}
if ((convertedPw >= 58) && (convertedPw <= 64))
{
symbols++;
}
if ((convertedPw >= 91) && (convertedPw <= 96))
{
symbols++;
}
if ((convertedPw >= 123) && (convertedPw <= 126))
{
symbols++;
}
counter++;
}
// #### >END< PROCESSING EACH CHARACTER ####
// INTERPRETE ANALYSIS RESULT
if ((counter >= 8) && (uLetters >= 1) && (lLetters >= 1) && (numbers >= 1) && (symbols >= 1))
{
Console.WriteLine("The Password is Secure!!!");
}
if (counter < 8)
{
Console.WriteLine("The Password Must be up to 8 Characters");
goto Begin;
}
if (uLetters == 0)
{
Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Upper Case Character");
goto Begin;
}
if (lLetters == 0)
{
Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Lower Case Character");
goto Begin;
}
if (numbers == 0)
{
Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Number");
goto Begin;
}
if (symbols == 0)
{
Console.WriteLine("The Password is Insecure. The Password Must Contain at Least One Symbol");
goto Begin;
}
Console.ReadLine();
}
}
}