C# Password Check Project -Assistance

Hey all,

I am fairly new to the programming community, but am preparing for an upcoming MTA exam and figured out the best way to prepare for exam is to study and get "hands-on"experience to hone in on the concepts taught. I started the C# program 2 weeks ago and am understanding fairly everything but hit my first wall in the learning path.

I am currently on the “Password Check” project where the program is designed to assess the user’s input (password) and determine its complexity using a scoring system. The problem seems to work, however the control blocks of my code are not performing as anticipated. The scoring method is granted scores when it is not supposed to. Every input i use as a proposed password give the score of “5”, regardless of complexity. based off the hint section in the project, the passwords “oooOVER-9000!” should return a score of “5”, “thatsallfolks” return a value of “2”, and " "(Spaces) should return a score of “0”. below is my code to see if anyone can help me identify where I went wrong. I refuse to look at the solution.

using System;

namespace PasswordChecker
{
  class Program
  {
    public static void Main(string[] args)
    {
//Define the variables that will be used as parameters for the password\\
      int minLength = 8;
      string upperCase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      string lowerCase = "abcdefghijklmnopqrstuvwxyz" ;
      string digits = "1234567890";
      string specialChars = "!@#$%^&*()-+=`~";
//Capture user input to run password checker program\\
      Console.WriteLine("Type in new password:");
      string newPassword = Console.ReadLine();
//Control the flow of program using boolean statements and determine point score of password\\
      int score = 0;
      int len =newPassword.Length;
      if (len >= minLength)
      {
        score++;
      }
      if (Tools.Contains(newPassword, upperCase));
      {
        score++;
      }
      if (Tools.Contains(newPassword, lowerCase));
      {
        score++;
      }
      if (Tools.Contains(newPassword, digits));
      {
        score++;
      }
      if (Tools.Contains(newPassword, specialChars));
      {
        score++;
      }
      //Print the password score to determine complexity\\
      Console.WriteLine(score);
    }
  }
}

Thanks!

Han_Deckard

You have a semi-colon after the if statement but before the code block you want to be associated with the if statement. This means that the if statement code block is empty and the score++ will always be run.