Ejercicio10.java 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author user
 */
public class Ejercicio10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] dias_laborales = new String[5];
        String input = new String();
        
        dias_laborales[0] = "lunes";
        dias_laborales[1] = "martes";
        dias_laborales[2] = "miercoles";
        dias_laborales[3] = "jueves";
        dias_laborales[4] = "viernes";      
        
        System.out.print("Introduzca un dia: ");
        input = sc.nextLine();
        System.out.println("");       
        
        for (int i = 0; i < 5; i++) {
            if(input.compareTo(dias_laborales[i]) == 0){
                System.out.println("Es laboral!");
                return;
            }
        }
        
        System.out.println("No es laboral!");
        
        
    }
}