Advertisement
Guest User

sofyyy

a guest
Aug 29th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 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.  
  7. package latihan.data.siswa;
  8.  
  9. import javax.swing.JOptionPane;
  10.  
  11. /**
  12. *
  13. * @author Haze
  14. */
  15. public class LatihanDataSiswa {
  16.  
  17. /**
  18. * @param args the command line arguments
  19. */
  20. public static void main(String[] args) {
  21. System.out.println("");
  22. System.out.println("Selamat Datang di aplikasi penghitung nilai rata rata");
  23.  
  24. String nama, nis;
  25. nama = JOptionPane.showInputDialog ("Nama siswa : ");
  26. nis = JOptionPane.showInputDialog ("Nomor Induk Siswa : ");
  27. System.out.println("Nama siswa : "+nama);
  28. System.out.println("Nomor induk siswa : "+nis);
  29.  
  30. double value_1 = Double.parseDouble (JOptionPane.showInputDialog("Masukkan Nilai pertama : "));
  31. double value_2 = Double.parseDouble (JOptionPane.showInputDialog("Masukkan Nilai pertama : "));
  32. System.out.println("Nilai Pertama adalah " +value_1 );
  33. System.out.println("Nilai Kedua adalah" +value_2 );
  34. System.out.println("");
  35. System.out.println("-------------------Hasil-------------------");
  36.  
  37.  
  38.  
  39.  
  40. System.out.println(+(value_1 + value_2)/2 );
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement