Advertisement
TheSTRIG

Untitled

Sep 26th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class absen-bonus
  4. {
  5.     public static void main(String[] args)
  6.     {
  7.         Scanner in = new Scanner(System.in);
  8.            
  9.         System.out.print("Nama: ");
  10.         String nama = in.nextLine();
  11.        
  12.             System.out.print("NPM: ");
  13.             int npm = in.nextInt();
  14.             if(npm < 100 || npm > 500 )
  15.             {
  16.                 System.out.println(nama + " dengan NPM " + npm + " TIDAK TERDAFTAR");
  17.                 System.exit(0);
  18.             }
  19.             else if((npm % 2) == 1)
  20.             {
  21.                 System.out.println(nama + " dengan NPM " + npm + " TIDAK TERDAFTAR");
  22.                 System.exit(0);
  23.             }
  24.        
  25.         in.nextLine();
  26.        
  27.        
  28.             System.out.print("Jurusan: ");
  29.             String jurusan = in.nextLine();
  30.             if(!jurusan.equals("Ilmu Komputer") && !jurusan.equals("Sistem Informasi"))
  31.             {
  32.                 System.out.println("Jurusan " + jurusan + " TIDAK TERDAFTAR");
  33.                 System.exit(0);
  34.             }
  35.        
  36.        
  37.        
  38.             System.out.print("Timestamp : ");
  39.             double timestamp = in.nextDouble();
  40.             if(timestamp <= 08.00)
  41.             {  
  42.                 System.out.println(nama + " dengan NPM " + npm + " TIDAK TERLAMBAT");
  43.             }
  44.             else
  45.             {
  46.                 System.out.println(nama + " dengan NPM " + npm + " TERLAMBAT");
  47.             }
  48.        
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement