Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package latihan.data.siswa;
- import javax.swing.JOptionPane;
- /**
- *
- * @author Haze
- */
- public class LatihanDataSiswa {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- System.out.println("");
- System.out.println("Selamat Datang di aplikasi penghitung nilai rata rata");
- String nama, nis;
- nama = JOptionPane.showInputDialog ("Nama siswa : ");
- nis = JOptionPane.showInputDialog ("Nomor Induk Siswa : ");
- System.out.println("Nama siswa : "+nama);
- System.out.println("Nomor induk siswa : "+nis);
- double value_1 = Double.parseDouble (JOptionPane.showInputDialog("Masukkan Nilai pertama : "));
- double value_2 = Double.parseDouble (JOptionPane.showInputDialog("Masukkan Nilai pertama : "));
- System.out.println("Nilai Pertama adalah " +value_1 );
- System.out.println("Nilai Kedua adalah" +value_2 );
- System.out.println("");
- System.out.println("-------------------Hasil-------------------");
- System.out.println(+(value_1 + value_2)/2 );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement