theloserboy

Untitled

Dec 19th, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import java.io.*;
  2. public class Pegawai
  3. {
  4. public static void main(String args[]) throws IOException
  5. {
  6. FileOutputStream out;
  7. PrintStream p;
  8. out = new FileOutputStream("Pegawai.txt");
  9. p=new PrintStream(out);
  10. System.out.println("--* Silahkan Menggunakan Program Menginputkan Nama Pegawai *-- \n");
  11. String nama="";
  12.  
  13. try
  14. {
  15. do
  16. {
  17. System.out.print("Nama Pegawai : ");
  18. BufferedReader bfr=new BufferedReader(new InputStreamReader(System.in));
  19. p.println(bfr.readLine());
  20. System.out.print("Inputkan lagi / selesai : ");
  21. nama = bfr.readLine();
  22. }
  23. while(!nama.equals("selesai"));
  24. {
  25. System.out.println("Seluruh Data Telah Masuk Kedalam Pegawai.txt");
  26. }
  27. }
  28.  
  29. catch(Exception e)
  30. {
  31. System.out.println("Program Error..");
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment