Código Java – Determinar Orden de Variables


//Codificado por sAfOrAs
public class DSCOrdenDeVariables
{
	void DetectaOrden(int a,int b,int c)
	{
		if (a<b && b<c)
			System.out.println("Las variables estan en orden CRECIENTE");
		else if (a>b && b>c)
			System.out.println("Las variables estan en orden DECRECIENTE");
		else
			System.out.println("Las variables estan en DESORDEN");
	}

	public static void main(String[] args)
	{
		int a=0,b=0,c=0;

		DSCOrdenDeVariables variable = new DSCOrdenDeVariables();
		if(args.length<3)
			System.out.println("Debe ingresar 3 variables");
		else
		{	
			a=Integer.parseInt(args[0]);
			b=Integer.parseInt(args[1]);
			c=Integer.parseInt(args[2]);		
			variable.DetectaOrden(a,b,c);
		}	
		
	}
}
Anuncio publicitario

8 comentarios sobre “Código Java – Determinar Orden de Variables

  1. //Mascotas.java

    public class Mascotas{
    public static void main(String[]args){
    System.out.println(«Mis Mascotas»);

    ver mimascota;

    miMascota = new Gato();
    miMascota.come(«ratones»); //despliega: El gato come ratones
    miMascota.come(«whiskas»); //despliega: El gato come whiskas

    miMascota = new Perro();
    miMascota.come(«huesos»); //despliega: El perro come huesos
    miMascota.come(«carne»); //despliega: El perro come carne

    miMascota = new Conejo();
    miMascota.come(«alfalfa»); //despliega: El conejo come alfalfa
    miMascota.come(«zanahorias»); //despliega: El conejo come zanahorias
    }
    }
    como lo soluciono

  2. nhnhujhjjjjjjjjjjjjjjjjjjjjjjjhutfvttcdtdrtdddrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrgas

  3. Hola
    Soy Topografo y quiero aprender este tipo de programacion
    para desarrollar en un futuro cercano mis propias aplicaciones para mi tables.
    Tendras un manual Simple para aprender sobre el codigo y los comandos y como es la sintaxis
    o como se estructura un programa

  4. AMIGO QUIERO SABER SI ME PODES AYUDAR AVECES TENEMOS CLASES DE PROGRAMACION Y MANEJAMOS JAVA Y NETBEANS ME PODES MANDAR TU FACEBOOK Y HABLAMOS POR AYA…

Deja tu comentario

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Salir /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Salir /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Salir /  Cambiar )

Conectando a %s