Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author zihadrizkyef
- */
- public class Ujian_LoginSystem {
- public static void main(String[] args) {
- String[] dataId={"zihad", "rizky", "edwin", "fikri", "fahmi", "azzain"};
- System.out.print("Masukan id anda : ");
- Scanner scanner=new Scanner(System.in);
- String idInputed = scanner.nextLine();
- for(int id=0; id<=dataId.length; id++) {
- if (id==dataId.length) {
- System.out.println("Id tidak di temukan");
- break;
- }
- if (idInputed.equals(dataId[id])) {
- System.out.println("Anda berhasil masuk dengan id : 0000"+String.valueOf(id+1));
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement