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);
}
}


