Entradas

Programa 6

/* * 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 comparar.cadenas; /** * * @author conalep */ public class CompararCadenas {    /**     * @param args the command line arguments     */    public static void main(String[] args) {        String cadena1 = new String("Hola");//crear el objeto cadena 1 y dandole un valor el valor hola        String cadena2 = new String("Hola");//crear el objeto cadena 2 y dandole un valor el valor hola        if(cadena1.equals(cadena2))//compara cadena 1 con cadena 2        { System.out.println("Cadenas iguales");//salida        }        String cadena3 = new String("Hola");//crear el objeto cadena 3 y dandole un valor el valor hola        String...

Programa 4

Programa para saber si un numero es capicua /*  * 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 ejercicio.pkg4; import java.util.Scanner; /**  *  * @author conalep  */ public class Ejercicio4 {     /**      * @param args the command line arguments      */     public static void main(String[] args) {      Scanner sc=new Scanner(System.in);        long falta,numeroInvertido,resto;  System.out.println("Ingresa un numero");   long numero=sc.nextLong(); while(numero<=0);   falta=numero;   numeroInvertido=0;   resto=0; resto=falta%10; falta=falta/10; numeroInvertido=numeroInvertido*10+resto; while(falta!=0) {  resto=falta%10; ...

Programa 1

/*  * 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 ejercicio.pkg1; import java.util.Scanner; /**  *  * @author conalep  */ public class Ejercicio1 {    /**      * @param args the command line arguments      */     public static void main(String[] args) {          Scanner sc=new Scanner(System.in);          System.out.println("Paulina Guadalupe Rios Valdez");          System.out.println("Captura una variable de tipo entero: ");          int j=sc.nextInt();          System.out.println("Ciclo FOR ");         for(int x=1;x<=5;x++){             System.out.println(j); ...

tipos de datos

/*  * 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 tipos.de.datos; import java.util.Scanner; /**  *  * @author conalep  */ public class TiposDeDatos {     /**      * @param args the command line arguments      */     public static void main(String[] args) {         Scanner sc=new Scanner(System.in);//Creando objeto sc de la clase Scanner         System.out.println("Captura de numero ");//Imprime mensaje         int j=sc.nextInt();//Captura de una variable entera         System.out.println("Variabe entera: "+j);//Imprime mensaje y variabe         System.out.println("Ciclo FOR ");         for(int i=1;i<=j;i++){   ...