Map

Translate

English French German Spain Italian Dutch

Russian Brazil Japanese Korean Arabic Chinese Simplified
Translate by Google ( UBLO 7 )

visitor

Flag Counter

About Me

PROGRAM MENGHITUNG GAJI BERSIH (JAVA)

KODE :


package methods;
import javax.swing.JOptionPane;
import java.text.DecimalFormat;
public class GajiBersih {
             
public static double gajibersih (int GP, double UM) {
       double GB;
       if (GP < 0)
              return 0;
       else
              GB = GP/100*90 + UM;
       return GB;
}
public static void main(String[] args) {
       String Ulang = "";
       do{
       String inputGP = JOptionPane.showInputDialog(null, "MASUKAN GAJI POKOK + PAJAK 10% ");
       int GP = Integer.parseInt(inputGP);
       String inputUM = JOptionPane.showInputDialog(null, "MASUKAN UANG MAKAN ? ");
       double UM = Float.parseFloat(inputUM);         
       double HasilGB = gajibersih(GP, UM);
       DecimalFormat x = new DecimalFormat("RP#########");
       String z = x.format(HasilGB);
       JOptionPane.showMessageDialog(null, "GAJI BERSIH = "+z);
       Ulang = JOptionPane.showInputDialog(null, "ULANG LAGI [Y]YA|[T]TIDAK? : ");
       } while ((Ulang.charAt(0) == 'Y' ) || (Ulang.charAt(0) == 'Y' ));
}
}

HASIL :






0 komentar:

Posting Komentar

Jam

Pesan

Salju