5
INSTITUTO TECNOLÓGICO DE MINATITLAN ALUMNOS: REYES CRUZ ISMAEL HERNANDEZ MACHUCA MIGUEL ANGEL CARRERA: ING. ELECTRONICA PROGRAMACION VISUAL PROFESORA: ING.GUILLERMINA JIMENEZ RASGADO TEMA: PROGRAMA EN JAVA CON NetBeans IDE 7.4

Programa en net beans ide

Embed Size (px)

Citation preview

Page 1: Programa en net beans ide

INSTITUTO TECNOLÓGICO DE

MINATITLAN

ALUMNOS:

REYES CRUZ ISMAEL

HERNANDEZ MACHUCA MIGUEL

ANGEL

CARRERA: ING. ELECTRONICA

PROGRAMACION VISUAL

PROFESORA: ING.GUILLERMINA

JIMENEZ RASGADO

TEMA: PROGRAMA EN JAVA CON

NetBeans IDE 7.4

Page 2: Programa en net beans ide

/*

* 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.

EL programa puede construirse empleando varias clases.

*/

/*

ESTE PROGRAMA PIDE 2 NUMEROS E IMPRIME EL

NUMERO QUE ES MAYOR O NOS DICE SI LOS NUMEROS

SON IGUALES.

*/

/*

El package es el contenedor de clases que permite agrupar

las distintas partes de un programa

.*/

Page 3: Programa en net beans ide

package comparar.numeros;

import java.util.Scanner;

/*Es la biblioteca para usar el teclado o ingresar datos*/

/**

* @author ISMAEL HP

*/

/*

El nombre de la clase que creamos es

COMPARARNUMEROS, el public es de donde se puede

acceder a la clase ó miembros de la clase.

*/

public class COMPARARNUMEROS {/*clase*/

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

/*Es el constructor donde se desea crear el objeto */

Page 4: Programa en net beans ide

Scanner numero=new Scanner(System.in);

/* Scanner es la clase para ingresar datos */

/* variables que se van a usar */

/* atributos del programa*/

int x,y;

System.out.println("Introduzca primer numero");

x=numero.nextInt();

System.out.println("Introduzca segundo numero");

y=numero.nextInt();

/* En esta parte el programa verifica si se cumple la

condición y nos dice cual es el mayor de los números o si los

números son iguales */

if(x==y)

System.out.println("Los numeros son iguales

:"+x+"&"+y);

if(x>y)

System.out.println("El primer es mayor: "+x);

else

if(y>x)

System.out.println("El segundo numero es mayor:

"+y);

Page 5: Programa en net beans ide

// TODO code application logic here

}

}