Ejercicio10.java 758 Bytes
Newer Older
Silvia Barrientos committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
import java.util.Scanner;

public class Ejercicio10 {
    public static void main(String[] args) {
        final String[] dias = {"domingo", "lunes", "martes", "miercoles", "jueves", "viernes", "sabado"};
        Scanner entrada = new Scanner(System.in);
        System.out.printf("Ingrese un dia: ");
        String dia = entrada.nextLine();
        
        if(dia.equals(dias[0]) || dia.equals(dias[6])){
            System.out.printf("El " + dia + " no es un dia laboral\n");
        }else{
            for(int i = 1; i < dias.length - 1; i++){
                if(dia.equals(dias[i])){
                    System.out.printf("El " + dia + " es un dia laboral\n");
                }
            } 

        }
        
        entrada.close();
    }
    
}