package empleado;
import javax.swing.*;
public class empleados {
String nombre,puesto;
double sueldo,sn,deducciones,prestaciones;
int np;
public empleados()
{
nombre=JOptionPane.showInputDialog("NOMBRE");
puesto=JOptionPane.showInputDialog("PUESTO");
sueldo=Double.parseDouble(JOptionPane.showInputDialog("SUELDO"));
}
public double calimpuestos()
{
sn=sueldo-(sueldo*.08);
return sn;
}
public double prestadicionales()
{
String con;
con=JOptionPane.showInputDialog("CONCEPTO");
prestaciones = Double.parseDouble(JOptionPane.showInputDialog("MONTO DE PRESTACION"));
return prestaciones;
}
public String DatosEmp()
{
String x="\nNOMBRE:"+nombre+"\nPUESTO:"+puesto;
x=x+"\nSUELDO:"+sueldo;
return x;
}
}
package empleado;
import javax.swing.*;
public class Emple {
public static void main(String[] args) {
// TODO code application logic here
double d,p=0,totalpres=0,total;
int b=0,i;
empleados E=new empleados();
d=E.calimpuestos();
int a=Integer.parseInt(JOptionPane.showInputDialog("EL EMPLEADO TIENE PRESTACIONES ADICIONALES: \n1.-SI \n2.-NO"));
if(a==1)
b=Integer.parseInt(JOptionPane.showInputDialog("CUANTAS PRESTACIONES TIENE: "));
for(i=0; i {
p=E.prestadicionales();
totalpres=totalpres+p;
}
total=totalpres+d;
JOptionPane.showMessageDialog(null,"\nNOMINA: "+ E.DatosEmp()+"\nSUELDO MENOS IMPUESTOS: "+d+" \nTOTAL DE PRESTACIONES: "+totalpres +" \n TOTAL INGRESOS: " +total);
}
}
No hay comentarios:
Publicar un comentario