Advertisement
Guest User

adsfasdfg

a guest
Mar 4th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. package javaapplication3;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5. static String[] user = new String []{"aaa","bbb","ccc"};
  6. static String[] pass = new String []{"111","222","333"};
  7. static String[] name = new String []{"Arniel Reyes","Arniel","Reyes"};
  8. static int[] age = new int []{18, 19, 20};
  9. static char[] gender = new char[] {'M','M','M'};
  10. static Scanner sc = new Scanner(System.in);
  11.  
  12. public static void main(String[] args) {
  13. String loginuser=account("User: ");
  14. String loginpass=account("Password: ");
  15. int a = accverif(loginuser, loginpass);
  16. Display(a);
  17. }
  18.  
  19. static String account(String b){
  20. System.out.print(b);
  21. String USE = sc.nextLine();
  22. return USE;
  23. }
  24.  
  25. static int accverif(String z, String x){
  26. int a = 0;
  27. for(a=0;a<name.length;a++){
  28. if((z.equals (user[a]))&(x.equals (pass[a]))){
  29. System.out.println("LOGIN SUCCESS");
  30. break;
  31. }
  32. }
  33.  
  34.  
  35. return a;
  36. }
  37.  
  38. static void Display(int i){
  39. System.out.println("Name: "+ name[i]);
  40. System.out.println("Age: "+ age[i]);
  41. System.out.println("Gender: "+ gender[i]);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement