import java.io.*;
public class nim
{
public static void main (String args[])
{
String namajurusan="";
double biayasks=0.0;
try {
BufferedReader BufNama = new BufferedReader (new InputStreamReader(System.in));
System.out.print("Nama Anda : ");
String nama=BufNama.readLine ();
// 11120001107 11=kode jur 1=jkel 2001=thn angkatan 107 = no urut
BufferedReader BufNim = new BufferedReader (new InputStreamReader(System.in));
System.out.print("NIM Anda : ");
String nim=BufNim.readLine ();
// ambil char Nim
String jurusan = nim.substring(0,2);
String jeniskelamin = nim.substring (2,3);
String thn_ang = nim.substring (3,7);
String no_urut = nim.substring (7);
// jurusan
if (jurusan.equals("11")){namajurusan ="Teknik Komputer";biayasks=20000;}
else if (jurusan.equals("12")){namajurusan ="Teknik Mesin";biayasks=17000;}
else if (jurusan.equals("13")){namajurusan ="Teknik Sipil";biayasks=18000;}
else {namajurusan = "Salah Isi";biayasks=0;}
// Jk
if (jeniskelamin.equals("1")) {jeniskelamin ="laki-laki";}
else if (jeniskelamin.equals("2")) {jeniskelamin ="Perempuan";}
else {jeniskelamin = "Salah Isi";}
System.out.println(namajurusan);
System.out.println(biayasks);
System.out.println(jeniskelamin);
System.out.println(thn_ang);
System.out.println(no_urut);}
catch (IOException e)
{
e.printStackTrace();
}
}
}
Categories:
java