-
-
Save codecademydev/d354f618ff0edf5edd2ba0a04d93284a to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace PasswordChecker | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
int minLength = 8; | |
string uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
string lowercase = "abcdefghijklmnopqrstuvwxyz"; | |
string digits = "0123456789"; | |
string specialChars = "!@#$%^&*?"; | |
int score = 0; | |
Console.Write("Input your password: "); | |
string password = Console.ReadLine(); | |
if (password.Length >= minLength) | |
{ | |
score++; | |
} | |
if (Tools.Contains(password, uppercase)); | |
{ | |
score++; | |
} | |
if (Tools.Contains(password, lowercase)); | |
{ | |
score++; | |
} | |
if (Tools.Contains(password, digits)); | |
{ | |
score++; | |
} | |
if (Tools.Contains(password, specialChars)); | |
{ | |
score++; | |
} | |
Console.WriteLine(score); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment