It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

Anyone~ PLease Help me

Anyone~ PLease Help me

Postby kdreamx on Mon Mar 19, 2007 9:02 pm

I have to write a program that takes two words as input from the keyboard, representing a user ID and password. Also, i have to do the following:
If the user ID and password match "admin" and "open", then output
"Welcome"
If the user ID matches "admin" and the password does not match "open,"
output "Wrong password"

Now, i Don't know if have to use if/else or switch statements for this.
The following is what i have done so far.
Can anyone help me on this???

===========================================
import javax.swing.JOptionPane;
import java.lang.*;

public class Season
{
public static void main(String [ ] args)
{
char ID;
char password;

String input1 = JOptionPane.showInputDialog(null, "Please enter your ID.");
String input2 = JOptionPane.showInputDialog(null, "Please enter youe password.");

ID = input1.charAt(0);
password = input2.charAt(0);


}
}
kdreamx
 
Posts: 2
Joined: Mon Mar 19, 2007 8:56 pm

Who is online

Users browsing this forum: No registered users and 1 guest