Hey guys, I'm learning
java right now, and I would like some input on this code. What it is, is a login if/else statement. I'm trying to get the user to have an option to make his/her own login active and able to flow with the program as normal.. Hold on, it's probably easier to show you.. here you go:
//an excerpt from my program.
System.out.println();
do{
System.out.println("Imput your UserID or Say 'New User' to register a New name.");
System.out.println();
System.out.println("UserID: ");
String usID=input.readLine();
if (usID.equals("New User")||(usID.equals("New user"))||(usID.equals("new user"))){
System.out.println();
System.out.println("Please imput your new UserID: ");
String NewUID=input.readLine();
System.out.println();
System.out.println("Thank you. Now Enter your new password.");
String NewUPass=input.readLine();
System.out.println();
System.out.println("Thank you. This process is complete.");
Util.skip(2);
System.out.println("Your Username is: "+NewUID);
System.out.println("And your password is: "+NewUPass);
//----------------------------------------------------------------
Util.skip(2);
System.out.println("We're sorry. This feature is currently Disabled.");
System.out.println("Please login as 'Guest' using the password 'Guest'.");
System.out.println("\t\t\t\t- Phobos Team ::");
Util.skip(3);
loop1='n';
}//end register new user.
//**********************************************************************
else if (usID.equals("dmz")||(usID.equals("Guest"))||(usID.equals("guest"))||(usID.equals(NewUID)))
The problem I'm Actually having is with the last if.. it says "Cannot find symbol variable NewUID" however, it's declared as user input by putting
String NewUID=input.readLine();
etc...
Can anyone please help? some insight? tips? =] This is my first forum post, and I'm really new to java.. I'm attending a High School computer science class.. so I'm really having to just study this by myself... However, I'll be taking the online courses in Jan. So please go easy on me! =D If it cant be done, just tell me and I'll be quiet. =] but if it can, I will Definately Appreciate the help.. =]
Thanks. Dustin Moorman.