Wednesday, 23 October 2013

Contoh program sederhana




import java.util.*;
import java.io.*;
             
class masukkan {
public static void main(String[]args){
String nama;
String kelas;
String jurusan;
String npm;

Scanner inpt= new Scanner (System.in);
             
            System.out.print("Masukan Nama                  :");
            nama = inpt.nextLine();
            System.out.print("Masukan Kelas                  :");
            kelas = inpt.nextLine();
            System.out.print("Masukan Jurusan               :");
            jurusan = inpt.nextLine();
            System.out.print("Masukan NPM                   :");
            npm = inpt.nextLine();
             
             
            System.out.println("Nama Lengkap      :    "  + nama);
            System.out.println("Kelas             :    "  + kelas);
            System.out.println("Jurusan           :    "  + jurusan);
            System.out.println("Npm               :    "  + npm);
                  }

            }

1 comments:

Post a Comment