Advertisement
Guest User

hehehhe

a guest
Mar 4th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. package javaapplication1;
  2. import java.util.Scanner;
  3.  
  4. public class Main {
  5. static String[] name = new String []{"aaa","bbb","ccc"};
  6. static String[] pass = new String []{"111","222","333"};
  7. static String[] user = 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. static boolean reply = true;
  12.  
  13.  
  14. public static void main(String[] args) {
  15. String loginuser=account("User: ");
  16. String loginpass=account("Password: ");
  17. accverif(loginuser, loginpass);
  18. }
  19.  
  20. static String account(String a){
  21. Scanner sc = new Scanner (System.in);
  22. System.out.print(a);
  23. String USE = sc.nextLine();
  24. return USE;
  25. }
  26.  
  27. static int accverif(String z, String x){
  28. while(reply){
  29. for(int a=0;a<name.length;a++){
  30.  
  31. if((z.equals (name[0]))&(x.equals (pass[0]))& (reply = true)){
  32. yes();
  33. Display(0);
  34. break;
  35. }
  36. if((z.equals (name[1]))&(x.equals (pass[1]))& (reply = true)){
  37. yes();
  38. Display(1);
  39. break;
  40. }
  41. if((z.equals (name[2]))&(x.equals (pass[2]))& (reply = true)){
  42. yes();
  43. Display(2);
  44. break;
  45. }
  46. else{
  47. System.out.println("Wrong data");
  48. reply = false;
  49. break;
  50. }
  51. }
  52. }
  53. return 0;
  54. }
  55.  
  56. static boolean yes() {
  57. System.out.println("LOGIN SUCCESS");
  58. return reply = false;
  59. }
  60.  
  61. static void Display(int a){
  62. System.out.println("Name: "+user[a]);
  63. System.out.println("Age: "+age[a]);
  64. System.out.println("Gender: "+gender[a]);
  65.  
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement