DOnt know if 1st post if did, I am VERY sorry for duplicate post. I have error messg
The dreaded error message that I am getting and I CANNOT understand lookup anything is: PasswordTest.java:70: class, interface, or enum expected
I dont know if it is common to copy the whole program so it would be easier to see why the error would be coming from. If this is a problem I am sorry also...
so if there is anybody that can help this very stuck student in trying to finish their project before school gets out it would br gretly appreciated to anybody who had ANY ideas for me. Thank you much. Slight break down... Password checker, has to check 6 password, check length, must B 6 dig lond, must have lc dig and a uc dig and it must have 1 num dig in it, then count the valid and bad passwords
import javax.swing.*; //to use JOptionPane
import java.util.Scanner; // use for Scanner
public class PasswordTest
{
private static String passwordsBeingEntered; // the passwords that are being entered
private static String testPlansAuthor;// name of the author who is testing their passwords
private static String reportString; // this is the output string
private static int numberOfPasswords; // total number of passwords
private static int validPassword; // how many of the passwards that have been entered are good
private static int badPassword; //how many of the passwords that have been entered are bad
private static final int PASSWORD_LENGTH = 6; // minimum number of password there are supposed to be
private static boolean checkLength = false; // checks to see if the length is 6 or over
private static boolean checkLowercase = false; // checks to see if password has a lowercase letter
private static boolean checkUppercase = false; // checks to see if password has a uppercase letter
private static boolean checkDigit = false; // checks to see if the password has a digit in it
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
PasswordTest mypassword = new PasswordTest();
mypassword.startPasswordChecker();
for (index = 0; index < 1; index++)
{
mypassword.inputPassword();
// mypassword.checkLength();
}
}
public static void startPasswordChecker()
{
System.out.println("Please welcome to the Password Checker Program" +
"\n\nThis prgram asks the user how many passwords they choose to check" +
"\n and the computer will determine how many of the passwords are valid and how many are bad");
numberOfPasswords = Integer.parseInt(JOptionPane.showInputDialog("Plea se enter how many " +
"passwords you would like to check?"));
testPlansAuthor = (JOptionPane.showInputDialog("Please enter your name?"));
// this string that will help with the output at the end of the program
String reportString = ("Results of Password Checker" +
"\n\nTest plans were made by " + testPlansAuthor +
"\nPasswords checked:" + numberOfPasswords +
"\n Good Passwords:" + validPassword + " bad Passwords" + badPassword);
}// end of startPasswordChecker method
//This method allows the user to input the passwords using the scanner option
public static void inputPassword()
{
System.out.println("Please enter the password that you would like tested? ");
passwordsBeingEntered = keyboard.nextLine();
inputChar = inputLine.charAt(0);
}
}//end of inputPasswordMethod
// This method checks the length of all passwords submitted to make sure they meed the
// length required
public static void checkLength()
{
if (passwordsBeingEntered.length() > 6)
checkLength = true;
else
checkLength = false;
}// end of checkLength Method
}// end of class