/*
* 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_1;
import java.util.Scanner;
/**
*
* @author user
*/
public class Ejercicio_1 {
/**
* @param args the command line arguments
*/
public static int dimension, c, multiplicacion=1;
public static Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
System.out.println("ingrese la dimension del arreglo");
dimension = scn.nextInt();
int vec[] = new int[dimension];
for (c = 0; c <= (dimension - 1); c = c + 1) {
System.out.println("Ingrese los numeros solo del 1 al 9");
System.out.println("Numeros " + c);
vec[c] = scn.nextInt();
if (vec[c] >= 0 & vec[c] <= 9) {
} else {
System.out.println("fuera de rango solo numeros del 0 al 9");
}
}
for (c = 0; c <= dimension; c++) {
System.out.println(c + ": " + vec[c]);
multiplicacion = multiplicacion * vec[c];
System.out.println("Multiplicacion " + multiplicacion);
}
}
}
……………………………………………………
/*
* 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 ejercicio2;
import java.util.Scanner;
/**
*
* @author user
*/
public class Ejercicio2 {
/**
* @param args the command line arguments
*/
public static int dimension, co, posicion;
public static String nombre;
public static Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Ingrese la Dimension del vector");
dimension = scn.nextInt();
String vec[] = new String[dimension];
System.out.println("Ingrese el nombre que desea buscar ");
nombre = scn.next();
for (co = 0; co <= (dimension - 1); co = co + 1) {
System.out.println("Ingrese el nombre " + co);
vec[co] = scn.next();
if (vec[co].equals(nombre)) {
posicion = co;
System.out.println("SI EXISTE");
System.out.println("Esta en la pocicion " + posicion);
} else {
System.out.println("NO EXISTE");
}
}
}
}
/*
* 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 ejercicio3;
import java.util.Scanner;
/**
*
* @author user
*/
public class Ejercicio3 {
/**
* @param args the command line arguments
*/
public static int co,co2,co3;
public static String aux,cadena;
public static Scanner scn=new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Ingrese la la palabra o el texto");
cadena=scn.next();
for(co=cadena.length()-1;co>=0;co=co-1){
aux=aux+cadena.charAt(co);
for(co2=0;co2<=aux.length()-1;co++){
if(aux.charAt(co2)==cadena.charAt(co2)){
co3++;
}
}
}
if(co3==cadena.length()){
System.out.println("Es un Palondrimo");
}else{
System.out.println("No es un Palondrimo");
}
}
}
__________________________________________
/*
* 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 ejercicio4;
import java.util.Scanner;
/**
*
* @author user
*/
public class Ejercicio4 {
/**
* @param args the command line arguments
*/
public static int co, dimension, aux, posicion;
public static Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Ingrese la dimension del vector");
dimension = scn.nextInt();
int vec[] = new int[dimension];
for (co = 0; co <= (dimension - 1); co = co + 1) {
System.out.println("Ingrese los numeros");
System.out.println("numero " + co);
vec[co] = scn.nextInt();
aux = vec[co];
if (aux >= vec[co]) {
posicion = co;
}
}
System.out.println("El numero mayor es " + aux);
System.out.println("Y esta en la posicion " + posicion);
}
}
/*
* 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 ejercicio5;
import java.util.Scanner;
* @author user
*/
public class Ejercicio5 {
/**
* @param args the command line arguments
*/
public static int co, dimension, auxmayor, promedio, auxmenor, ac;
public static Scanner scn = new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Ingrese la dimension del vector");
dimension = scn.nextInt();
int vec[] = new int[dimension];
for (co = 0; co <= (dimension - 1); co = co + 1) {
System.out.println("Ingrese los numeros");
System.out.println("Numero" + co);
vec[co] = scn.nextInt();
auxmayor = vec[0];
if (auxmayor > vec[co]) {
auxmayor = vec[co];
}
auxmenor = vec[0];
if (auxmenor < vec[co]) {
auxmenor = vec[co];
}
ac = ac + vec[co];
}
promedio = ac / co;
System.out.println("El numero Menor es= " + auxmayor);
System.out.println("El numero Mayor es= " + auxmenor);
System.out.println("Suma= " + ac);
System.out.println("Promedio= " + promedio);
}
}
/*
* 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 ejercicio6;
/**
*
* @author user
*/
public class Ejercicio6 {
/**
* @param args the command line arguments
*/
public static int num=1,num2=1,num3=0,co=0;
public static void main(String[] args) {
// TODO code application logic here
int vec[]=new int [10];
for(co=1;co<=9;co=co+1){
num3=(num3-num)+(num2-2);
num=num;
num2=num3;
vec[co]=num3;
System.out.println(vec[co]);
}
}
}
/*
* 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 ejercicio8;
import java.util.Scanner;
/**
*
* @author user
*/
public class Ejercicio8 {
/**
* @param args the command line arguments
*/
public static int dimension,co,posicion;
public static Scanner scn=new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
System.out.println("Ingrese la dimension del vector");
dimension=scn.nextInt();
int vec[]=new int [dimension];
for(co=0;co<=(dimension-1);co=co+1){
System.out.println("Ingrese los numeros");
System.out.println("numero"+co);
vec[co]=scn.nextInt();
if(vec[co]%2==0){
posicion=co;
System.out.println(vec[co]);
System.out.println(posicion);
}
}
}
}
/*
* 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 ejercicio9;
import java.util.Scanner;
/**
*
* @author user
*/
public class Ejercicio9 {
/**
* @param args the command line arguments
*/
public static int secuencia=1,co=0,secuencia2;
public static int vec[]=new int [20];
public static Scanner scn=new Scanner(System.in);
public static void main(String[] args) {
// TODO code application logic here
for(co=1;co<=20;co=co+1){
if(co%2!=0){
secuencia2=secuencia-4;
vec[co]=secuencia;
}
else if(co%2==0){
secuencia2=secuencia+5;
vec[co]=secuencia2;
}
System.out.println(vec[co]);
}
}
}

Base de-datos

  • 1.
    /* * To changethis 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_1; import java.util.Scanner; /** * * @author user */ public class Ejercicio_1 { /** * @param args the command line arguments */ public static int dimension, c, multiplicacion=1; public static Scanner scn = new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here System.out.println("ingrese la dimension del arreglo"); dimension = scn.nextInt(); int vec[] = new int[dimension]; for (c = 0; c <= (dimension - 1); c = c + 1) { System.out.println("Ingrese los numeros solo del 1 al 9"); System.out.println("Numeros " + c); vec[c] = scn.nextInt(); if (vec[c] >= 0 & vec[c] <= 9) { } else { System.out.println("fuera de rango solo numeros del 0 al 9"); } } for (c = 0; c <= dimension; c++) { System.out.println(c + ": " + vec[c]); multiplicacion = multiplicacion * vec[c]; System.out.println("Multiplicacion " + multiplicacion); } } } ……………………………………………………
  • 2.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio2; import java.util.Scanner; /** * * @author user */ public class Ejercicio2 { /** * @param args the command line arguments */ public static int dimension, co, posicion; public static String nombre; public static Scanner scn = new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here System.out.println("Ingrese la Dimension del vector"); dimension = scn.nextInt(); String vec[] = new String[dimension]; System.out.println("Ingrese el nombre que desea buscar "); nombre = scn.next(); for (co = 0; co <= (dimension - 1); co = co + 1) { System.out.println("Ingrese el nombre " + co); vec[co] = scn.next(); if (vec[co].equals(nombre)) { posicion = co; System.out.println("SI EXISTE"); System.out.println("Esta en la pocicion " + posicion); } else { System.out.println("NO EXISTE"); } } } }
  • 3.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio3; import java.util.Scanner; /** * * @author user */ public class Ejercicio3 { /** * @param args the command line arguments */ public static int co,co2,co3; public static String aux,cadena; public static Scanner scn=new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here System.out.println("Ingrese la la palabra o el texto"); cadena=scn.next(); for(co=cadena.length()-1;co>=0;co=co-1){ aux=aux+cadena.charAt(co); for(co2=0;co2<=aux.length()-1;co++){ if(aux.charAt(co2)==cadena.charAt(co2)){ co3++; } } } if(co3==cadena.length()){ System.out.println("Es un Palondrimo"); }else{ System.out.println("No es un Palondrimo"); } } } __________________________________________
  • 4.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio4; import java.util.Scanner; /** * * @author user */ public class Ejercicio4 { /** * @param args the command line arguments */ public static int co, dimension, aux, posicion; public static Scanner scn = new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here System.out.println("Ingrese la dimension del vector"); dimension = scn.nextInt(); int vec[] = new int[dimension]; for (co = 0; co <= (dimension - 1); co = co + 1) { System.out.println("Ingrese los numeros"); System.out.println("numero " + co); vec[co] = scn.nextInt(); aux = vec[co]; if (aux >= vec[co]) { posicion = co; } } System.out.println("El numero mayor es " + aux); System.out.println("Y esta en la posicion " + posicion); } }
  • 5.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio5; import java.util.Scanner; * @author user */ public class Ejercicio5 { /** * @param args the command line arguments */ public static int co, dimension, auxmayor, promedio, auxmenor, ac; public static Scanner scn = new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here System.out.println("Ingrese la dimension del vector"); dimension = scn.nextInt(); int vec[] = new int[dimension]; for (co = 0; co <= (dimension - 1); co = co + 1) { System.out.println("Ingrese los numeros"); System.out.println("Numero" + co); vec[co] = scn.nextInt(); auxmayor = vec[0]; if (auxmayor > vec[co]) { auxmayor = vec[co]; } auxmenor = vec[0]; if (auxmenor < vec[co]) { auxmenor = vec[co]; } ac = ac + vec[co]; } promedio = ac / co; System.out.println("El numero Menor es= " + auxmayor); System.out.println("El numero Mayor es= " + auxmenor); System.out.println("Suma= " + ac); System.out.println("Promedio= " + promedio); } }
  • 6.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio6; /** * * @author user */ public class Ejercicio6 { /** * @param args the command line arguments */ public static int num=1,num2=1,num3=0,co=0; public static void main(String[] args) { // TODO code application logic here int vec[]=new int [10]; for(co=1;co<=9;co=co+1){ num3=(num3-num)+(num2-2); num=num; num2=num3; vec[co]=num3; System.out.println(vec[co]); } } }
  • 7.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio8; import java.util.Scanner; /** * * @author user */ public class Ejercicio8 { /** * @param args the command line arguments */ public static int dimension,co,posicion; public static Scanner scn=new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here System.out.println("Ingrese la dimension del vector"); dimension=scn.nextInt(); int vec[]=new int [dimension]; for(co=0;co<=(dimension-1);co=co+1){ System.out.println("Ingrese los numeros"); System.out.println("numero"+co); vec[co]=scn.nextInt(); if(vec[co]%2==0){ posicion=co; System.out.println(vec[co]); System.out.println(posicion); } } } }
  • 8.
    /* * To changethis license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio9; import java.util.Scanner; /** * * @author user */ public class Ejercicio9 { /** * @param args the command line arguments */ public static int secuencia=1,co=0,secuencia2; public static int vec[]=new int [20]; public static Scanner scn=new Scanner(System.in); public static void main(String[] args) { // TODO code application logic here for(co=1;co<=20;co=co+1){ if(co%2!=0){ secuencia2=secuencia-4; vec[co]=secuencia; } else if(co%2==0){ secuencia2=secuencia+5; vec[co]=secuencia2; } System.out.println(vec[co]); } } }