• Lenguaje

    Java usando Scanner

  • Descripción

    Se dará un bono de antigüedad a los empleados de una empresa. Si llevan menos de 5 años en el trabajo, se pagarán $200,000, de lo contrario, $250,000.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import java.util.Scanner;

public class BonoDeAntiguedad {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int antiguedad, bono;
        System.out.print("Ingresa el valor de antiguedad: ");
        antiguedad = in.nextInt();
        in.nextLine();
        if(antiguedad<5)
            bono=200000;
        else
            bono=250000;
        System.out.println("Valor de bono: " + bono);
    }

}