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!"); } }