UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 27 de mayo de 2015

DIA DE LA SEMANA




/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dia.de.la.semana;
import java.util.Scanner;
/**
 *

 */
public class DiaDeLaSemana {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    int n; String m="";
System.out.println("Ingresar un número del 1 al 7" );
Scanner teclado=new Scanner(System.in);
n=teclado.nextInt();


if(n==1){
m="DOMINGO";
System.out.println("EL DÍA DE LA SEMANA ES: "+m);}

if(n==2){
m="LUNES";
System.out.println("EL DÍA DE LA SEMANA ES: "+m);}

if(n==3){
m="MARTES";
System.out.println("EL DÍA DE LA SEMANA ES: "+m);}

if(n==4){
m="MIERCOLES";
System.out.println("EL DÍA DE LA SEMANA ES: "+m);}

if(n==5){
m="JUEVES";
System.out.println("EL DÍA DE LA SEMANA ES: "+m);}

if(n==6){
m="VIERNES";
System.out.println("EL DÍA DE LA SEMANA ES: "+m);}

if(n==7){
m="SABADO";

System.out.println("EL DÍA DE LA SEMANA ES: "+m);}
if (n<1)
    
{System.out.println("NÚMERO DE SEMANA ES INCORRECTO");}
  
if (n>7)
{System.out.println("NÚMERO DE SEMANA ES INCORRECTO");}

  

    }
}

No hay comentarios:

Publicar un comentario