SlideShare una empresa de Scribd logo
GUÍA DE USO DE LABORATORIOS
ESTUDIANTE: Kevin Adrian Granda Ponce
SEMESTRE: Segundo
PARALELO: “C”
TEMA:
Eclipse
OBJETIVO:
Desarrollar un programa que pueda leer una matriz unidimensional y sacar
múltiples resultados
RESULTADOS DE APRENDIZAJE
Comprensión del uso de matrices unidimensionales para realizar ejercicios como
a suma, resta, multiplicación y división.
ACTIVIDADES:
· Desarrollar un programa en donde se pueda crear un vector unidimensional para
que pueda obtener el número mayor y menor de una matriz, además de mostrar
datos por pantalla.
DESARROLLO DE CONTENIDOS
Capturas de Pantalla
Código del ejercicio
1. //Realizar un arreglo unidimensional en donde el
2. //tamaño del arreglo sea elegido por el usuario y
3. //saquemos los valores ingresados por pantalla ademas de
4. //determinar el número mayor y menor del arreglo.
5.
6.
7.
8. //DECLARAMOS VARIABLES
9. int num,i;
10.
11. //UTILIZACIÓN DEL SCANNER PARA GUARDAR DATOS
12. Scanner ingresar = new Scanner (System.in);
13.
14. //PEDIMOS EL INGRESO DEL TAMAÑO DE LA MATRIZ
15. System.out.println("Ingrese el tamaño de la matriz: ");
16. num = ingresar.nextInt();
17.
18. //GUARDAMOS EL VALOR INGRESADO POR PANTALLA A
LA MATRIZ
19. int [] matriz = new int [num];
20.
21. //EMPLEO DEL FOR PARA GUARDAR LOS DATOS DE LA
MATRIZ
22. for (i=0;i<num;i++) {
23.
24. System.out.println("Ingrese los numeros de la
matriz: ");
25. matriz [i] =ingresar.nextInt();
26. }
27.
28. //SALIDA DE LOS DATOS INGRESADOS A LA PANTALLA
29. for (i=0;i<num;i++) {
30.
31. System.out.println("Los numeros ingresados en la
matriz son: "+matriz[i]);
32.
33. }
34.
35. //DETERMINANOS EL NUMERO MAYOR DE LA MATRIZ
36. for (i=0;i<matriz.length;i++) {
37.
38. if (matriz[i]>num){
39.
40. num=matriz[i];
41.
42. }
43.
44. }
45.
46.
47. //SACAMOS POR PANTALLA EL RESULTADO DEL NUMERO
DE LA MATRIZ POR PANTALLA
48. System.out.println("El numero mayor es: "+num);
49.
50.
51. //DETERMINAMOS EL NUMERO MENOR DE LA MATRIZ
52.
53. for (i=0;i<matriz.length;i++) {
54.
55. if (matriz[i]<num){
56.
57. num=matriz[i];
58.
59. }
60.
61. }
62.
63. //SACAMOS POR PANTALLA EL RESULTADO DEL NUMERO
DE LA MATRIZ POR PANTALLA
64.
65. System.out.println("El numero menor es: "+num);
66.
67.
68. }
Kevin Adrian Granda Ponce MSc. Víctor Zapata
ESTUDIANTE DOCENTE

Más contenido relacionado

PDF
“Refuerzo de comando básicos matlab
PDF
Arreglo bidimensional ejercicio
PDF
Sentencia for (informe_10)
PDF
⭐⭐⭐⭐⭐ SOLUCIÓN EXAMEN SISTEMAS DIGITALES 2, Mejoramiento (2018 1er Término)
DOCX
Practica 10
PDF
Problema 5 Jara Molina Gerardo Uriel
PDF
Matrices en C++
DOCX
Práctico 5 Derivadas
“Refuerzo de comando básicos matlab
Arreglo bidimensional ejercicio
Sentencia for (informe_10)
⭐⭐⭐⭐⭐ SOLUCIÓN EXAMEN SISTEMAS DIGITALES 2, Mejoramiento (2018 1er Término)
Practica 10
Problema 5 Jara Molina Gerardo Uriel
Matrices en C++
Práctico 5 Derivadas

La actualidad más candente (9)

PDF
Ejercicios alg bucles
PDF
Guzman carlos tarea_2_2do_c(informe_7)
PPTX
Osar
PDF
Ejercicios programacion
DOCX
Repaso 2p
PPT
Estructuras De Datos
PDF
Problema 9 JM
PDF
Examen febrero2015 matemáticas
Ejercicios alg bucles
Guzman carlos tarea_2_2do_c(informe_7)
Osar
Ejercicios programacion
Repaso 2p
Estructuras De Datos
Problema 9 JM
Examen febrero2015 matemáticas
Publicidad

Similar a Ejercicio (20)

PDF
Ingresar las dimensiones de una matriz
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Arreglo bidimensional ejercicio
PDF
Informe de Kevin Yanza(AB).pdf
PDF
Switch case (informe_20)
DOCX
Formatos tutoria laboratorio
PDF
Informe de Jefferson Vega (AU).pdf
PDF
Editable
PDF
Editable
PDF
Editable
Ingresar las dimensiones de una matriz
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Arreglo bidimensional ejercicio
Informe de Kevin Yanza(AB).pdf
Switch case (informe_20)
Formatos tutoria laboratorio
Informe de Jefferson Vega (AU).pdf
Editable
Editable
Editable
Publicidad

Más de AlisonPrez4 (20)

PDF
Informe del proyecto final perez y pilco
PDF
Informe 19 reporte de base de datos
PDF
Informe 18 base de datos
PDF
Informe 17 base de datos
PDF
Informe de exposicion
PDF
Informe 15 tablas de multiplicar
PDF
Informe 13 meses switch
PDF
Informe 12 get y post
DOCX
Informe general (1) (1)
DOCX
Trabajo en grupo programación
PDF
Informe 10 metodo get
PDF
Informe 10 metodo get
PDF
Informe 6 iframe
PDF
Informe 7 div
PDF
Informe 5 formulario
PDF
Informe 3 programa
PDF
Informe 5 formulario
PDF
Informe 4 listas
Informe del proyecto final perez y pilco
Informe 19 reporte de base de datos
Informe 18 base de datos
Informe 17 base de datos
Informe de exposicion
Informe 15 tablas de multiplicar
Informe 13 meses switch
Informe 12 get y post
Informe general (1) (1)
Trabajo en grupo programación
Informe 10 metodo get
Informe 10 metodo get
Informe 6 iframe
Informe 7 div
Informe 5 formulario
Informe 3 programa
Informe 5 formulario
Informe 4 listas

Último (20)

DOC
TRABAJO MUNDIALIZACION - DILIA GONZALEZ.doc
PDF
La responsabilidad Civil del Menor, Esther Gomez
PPTX
PRINCIPIOS DE DERECHO PROCESAL PENAL.pptx
PDF
SIDH sistema interamericano DDHH 2025 1ra parte - compartido.pdf
PDF
DEFENSA TÉCNICA PAD - AUTOR JOSÉ MARÍA PACORI CARI
PPTX
CONFERENCIAACARIMINOLOGIA Y CRIMINALISTICA 2.pptx
PDF
Juicio de Particion y Disolucion de vinculo matrimonial.pdf
PPTX
Derechos fundamentales y garantías individuales
PPTX
§ 1.3 - Autoria y participación (s sgarcia).pptx
PPTX
PRACTICA CIVIL (6) (2).pptx xxxxxxxxxxxx
PPTX
CLASE ONCE DR. EDWIN SOVERO PEÑALOZA CONTESTACIÓN Y RECONVENCIÓN PROCESAL CIV...
PPTX
Derechos Humanos-Desigualdades-ODS..pptx
PDF
EL ANALISIS DELICTUAL EN LOS FUNCIONARIOS POLICIALES.pdf
PDF
LOCADORES DE SERVICIOS DEL ESTADO - DESNATURALIZACIÓN LABORAL - AUTOR JOSÉ MA...
PDF
MODELO ESCRITO RECLAMACIÓN DE CUMPLIMIENTO SILENCIO POSITIVO - AUTOR JOSÉ MAR...
PPTX
§ 1.2 - Fundamento y fines de la pena (S.Garcia).pptx
DOCX
MEDIOS ALTERNATIVOS 2.docx ccccccccccccc
PDF
Advertencia Pública sobre Rafael Eduardo Pinto Pocasangre en Izabal - Falso A...
PPTX
HÁBEAS CORPUS FINAL definitivo sexto.pptx
PDF
jurisprudencia sobre descuento al salario
TRABAJO MUNDIALIZACION - DILIA GONZALEZ.doc
La responsabilidad Civil del Menor, Esther Gomez
PRINCIPIOS DE DERECHO PROCESAL PENAL.pptx
SIDH sistema interamericano DDHH 2025 1ra parte - compartido.pdf
DEFENSA TÉCNICA PAD - AUTOR JOSÉ MARÍA PACORI CARI
CONFERENCIAACARIMINOLOGIA Y CRIMINALISTICA 2.pptx
Juicio de Particion y Disolucion de vinculo matrimonial.pdf
Derechos fundamentales y garantías individuales
§ 1.3 - Autoria y participación (s sgarcia).pptx
PRACTICA CIVIL (6) (2).pptx xxxxxxxxxxxx
CLASE ONCE DR. EDWIN SOVERO PEÑALOZA CONTESTACIÓN Y RECONVENCIÓN PROCESAL CIV...
Derechos Humanos-Desigualdades-ODS..pptx
EL ANALISIS DELICTUAL EN LOS FUNCIONARIOS POLICIALES.pdf
LOCADORES DE SERVICIOS DEL ESTADO - DESNATURALIZACIÓN LABORAL - AUTOR JOSÉ MA...
MODELO ESCRITO RECLAMACIÓN DE CUMPLIMIENTO SILENCIO POSITIVO - AUTOR JOSÉ MAR...
§ 1.2 - Fundamento y fines de la pena (S.Garcia).pptx
MEDIOS ALTERNATIVOS 2.docx ccccccccccccc
Advertencia Pública sobre Rafael Eduardo Pinto Pocasangre en Izabal - Falso A...
HÁBEAS CORPUS FINAL definitivo sexto.pptx
jurisprudencia sobre descuento al salario

Ejercicio

  • 1. GUÍA DE USO DE LABORATORIOS ESTUDIANTE: Kevin Adrian Granda Ponce SEMESTRE: Segundo PARALELO: “C” TEMA: Eclipse OBJETIVO: Desarrollar un programa que pueda leer una matriz unidimensional y sacar múltiples resultados RESULTADOS DE APRENDIZAJE Comprensión del uso de matrices unidimensionales para realizar ejercicios como a suma, resta, multiplicación y división. ACTIVIDADES: · Desarrollar un programa en donde se pueda crear un vector unidimensional para que pueda obtener el número mayor y menor de una matriz, además de mostrar datos por pantalla. DESARROLLO DE CONTENIDOS Capturas de Pantalla
  • 2. Código del ejercicio 1. //Realizar un arreglo unidimensional en donde el 2. //tamaño del arreglo sea elegido por el usuario y 3. //saquemos los valores ingresados por pantalla ademas de
  • 3. 4. //determinar el número mayor y menor del arreglo. 5. 6. 7. 8. //DECLARAMOS VARIABLES 9. int num,i; 10. 11. //UTILIZACIÓN DEL SCANNER PARA GUARDAR DATOS 12. Scanner ingresar = new Scanner (System.in); 13. 14. //PEDIMOS EL INGRESO DEL TAMAÑO DE LA MATRIZ 15. System.out.println("Ingrese el tamaño de la matriz: "); 16. num = ingresar.nextInt(); 17. 18. //GUARDAMOS EL VALOR INGRESADO POR PANTALLA A LA MATRIZ 19. int [] matriz = new int [num]; 20. 21. //EMPLEO DEL FOR PARA GUARDAR LOS DATOS DE LA MATRIZ 22. for (i=0;i<num;i++) { 23. 24. System.out.println("Ingrese los numeros de la matriz: "); 25. matriz [i] =ingresar.nextInt(); 26. } 27. 28. //SALIDA DE LOS DATOS INGRESADOS A LA PANTALLA 29. for (i=0;i<num;i++) { 30. 31. System.out.println("Los numeros ingresados en la matriz son: "+matriz[i]); 32. 33. } 34. 35. //DETERMINANOS EL NUMERO MAYOR DE LA MATRIZ 36. for (i=0;i<matriz.length;i++) { 37. 38. if (matriz[i]>num){ 39. 40. num=matriz[i]; 41. 42. } 43. 44. } 45. 46. 47. //SACAMOS POR PANTALLA EL RESULTADO DEL NUMERO DE LA MATRIZ POR PANTALLA
  • 4. 48. System.out.println("El numero mayor es: "+num); 49. 50. 51. //DETERMINAMOS EL NUMERO MENOR DE LA MATRIZ 52. 53. for (i=0;i<matriz.length;i++) { 54. 55. if (matriz[i]<num){ 56. 57. num=matriz[i]; 58. 59. } 60. 61. } 62. 63. //SACAMOS POR PANTALLA EL RESULTADO DEL NUMERO DE LA MATRIZ POR PANTALLA 64. 65. System.out.println("El numero menor es: "+num); 66. 67. 68. } Kevin Adrian Granda Ponce MSc. Víctor Zapata ESTUDIANTE DOCENTE