import java.util.Scanner;
public class Biodata2{
public static void main(String[] a){
String masukkanNama = null;
String masukkanAlamat = null;
String masukkanJenisKelamin = null;
String masukkanAgama = null;
Scanner masuk = new Scanner (System.in);
System.out.print("Masukkan Nama : ");
masukkanNama= masuk.nextLine();
System.out.print("Masukkan Alamat : ");
masukkanAlamat= masuk.nextLine();
System.out.print("Masukkan Jenis Kelamin : ");
masukkanJenisKelamin= masuk.nextLine();
System.out.println("Masukkan Agama : ");
System.out.println("1. Islam");
System.out.println("2. Katholik");
System.out.println("3. Protestan");
System.out.println("4. Hindu");
System.out.println("5. Budha");
System.out.println("Agama anda : ");
{int pil;
System.out.print("");
pil = masuk.nextInt();
switch (pil){
case 1:System.out.print("Islam");break;
case 2:System.out.print("Katholik");break;
case 3:System.out.print("Protestan");break;
case 4:System.out.print("Hindu");break;
case 5:System.out.print("Budha");break;
default: System.out.println("Salah Masukkan Pilihan");
break;
}
masukkanAgama= masuk.nextLine();}
System.out.println("Nama : " +masukkanNama);
System.out.println("Alamat : " +masukkanAlamat);
System.out.println("Jenis Kelamin : " +masukkanJenisKelamin);
System.out.println("Agama : " +masukkanAgama);
}
}
Tidak ada komentar:
Posting Komentar