Advertisement
zihadrizkyef

ujian-LoginBruteForce

Jun 23rd, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * To change this license header, choose License Headers in Project Properties.
  5.  * To change this template file, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8.  
  9. /**
  10.  *
  11.  * @author zihadrizkyef
  12.  */
  13. public class Ujian_LoginSystem {
  14.     public static void main(String[] args) {
  15.         String[] dataId={"zihad", "rizky", "edwin", "fikri", "fahmi", "azzain"};
  16.         System.out.print("Masukan id anda : ");
  17.         Scanner scanner=new Scanner(System.in);
  18.         String idInputed = scanner.nextLine();
  19.         for(int id=0; id<=dataId.length; id++) {
  20.             if (id==dataId.length) {
  21.                 System.out.println("Id tidak di temukan");
  22.                 break;
  23.             }
  24.             if (idInputed.equals(dataId[id])) {
  25.                 System.out.println("Anda berhasil masuk dengan id : 0000"+String.valueOf(id+1));
  26.                 break;
  27.             }
  28.         }
  29.        
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement