Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package modul04;
  7.  
  8. /**
  9. *
  10. * @author OBING CN
  11. */
  12.  
  13. import java.io.BufferedReader;
  14. import java.io.File;
  15. import java.io.FileNotFoundException;
  16. import java.io.FileReader;
  17. import java.io.IOException;
  18. import java.io.PrintWriter;
  19. import java.util.Scanner;
  20.  
  21.  
  22. public class modul3 {
  23. public static void main(String[] args){
  24. File file = new File ("D:/Praktikum2.txt");
  25. try {
  26. file.createNewFile();
  27. PrintWriter pewe = new PrintWriter(file);
  28.  
  29. } catch(Exception e){
  30. System.out.println("Gagal membuat file "+file.getPath());
  31. }
  32. Scanner input = new Scanner(System.in);
  33. System.out.print("Masukkan Jumlah Transaksi : ");
  34. int n = input.nextInt();
  35. String Deskripsi ;
  36. int Harga ;
  37.  
  38. for(int i=0;i<=n;i++){
  39. System.out.print("Deskripsi: ");
  40. Deskripsi = input.nextLine();
  41. input.nextLine();
  42. System.out.println("Harga");
  43. Harga = input.nextInt();
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. }
  54. }
  55.  
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement