static int sueldo(int v){
int resultado;
if(v>0 && v<=2){
resultado=1500000;
}
else if(v>2 && v<=5){
resultado=2500000;
}
else if(v>5 && v<=10){
resultado=5000000;
}
else if(v>10 && v<=20){
resultado=10000000;
}
else{
resultado=0;
}
return resultado;
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int r=Integer.parseInt(JOptionPane.showInputDialog("INSERTE TIEMPO DE TRABAJO"));
System.out.println(r);
float p=Sueldo.sueldo(r);
JOptionPane.showMessageDialog(null, p);
}
}
No hay comentarios:
Publicar un comentario