Advertisement
TheSTRIG

absen

Sep 26th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class absen
  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.        
  20.        
  21.         in.nextLine();
  22.        
  23.        
  24.             System.out.print("Jurusan: ");
  25.             String jurusan = in.nextLine();
  26.             if(!jurusan.equals("Ilmu Komputer") && !jurusan.equals("Sistem Informasi"))
  27.             {
  28.                 System.out.println("Jurusan " + jurusan + " TIDAK TERDAFTAR");
  29.                 System.exit(0);
  30.             }
  31.        
  32.        
  33.        
  34.             System.out.print("Timestamp : ");
  35.             double timestamp = in.nextDouble();
  36.             if(timestamp <= 08.00)
  37.             {  
  38.                 System.out.println(nama + " dengan NPM " + npm + " TIDAK TERLAMBAT");
  39.             }
  40.             else
  41.             {
  42.                 System.out.println(nama + " dengan NPM " + npm + " TERLAMBAT");
  43.             }
  44.        
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement