import java.util.*;
import java.lang.*;
/**
* To output whether a students chosen password is valid or not.
*
* @author (Sean McGlone
* @version (December 13, 2010)
*/
class SemesterProject
{
public static void main(String[]args)throws Exception
{
Scanner scanReader = new Scanner(System.in);
String password = "";
boolean firstLoop = true;
int length = 0;
int passwordLength = 0;
int countCaps = 0;
System.out.println("This was made by Sean McGlone");
System.out.print("Please enter a password consisting of 12 characters to be checked for validity: ");
password = scanReader.nextLine ();
passwordLength = password.length ();
do
{
try
{
if (passwordLength == 12)
{
System.out.println("Your pasword meets the length requirements");
}
else
{
throw new Exception ();
}
}
catch (Exception ex)
{
System.out.println("Please enter a valid password consisting of 12 characters: ");
password = scanReader.nextLine ();
}
}
while (firstLoop = true);
}
}