EJERCICIO VOCALES Y NUMEROS JAVA SWITCH CASE

/*
 * 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.
 */
package vocales;
import java.util.Scanner;

/**
 *
 * @author 305
 */
public class Vocales {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    Scanner teclado=new Scanner (System.in);
       int Vocal;
       System.out.println ("Ingrese un numero del  1 - 5: ");
       Vocal = teclado.nextInt();
       System.out.println();
     
       switch (Vocal)
     
       {
           case 1: System.out.println("el numero representa una a");
           break;
         
           case 2: System.out.println("el numero representa una e");
           break;
         
           case 3: System.out.println("el numero representa una i");
           break;
         
           case 4: System.out.println("el numero representa una o");
           break;
         
           case 5: System.out.println("el numero representa una u");
           break;
         
         
           default:
                System.out.println("QUE HASTA 5, ¡NO SEA BRUTO!");
         
         
     
     
       }
     
    }
   
}

Share this

Related Posts

Previous
Next Post »