SlideShare una empresa de Scribd logo
1 de 20
Faculty: Systems engineer
Course: Introduction of Programming
Topic: vectores y arreglos
________________________________________________
Socializer: Luis Fernando Castellanos Guarín
Karen Daniela Cuervo Cely
Email: Luis.castellanosg@usantoto.edu.co
Karen.cuervo@usantoto.edu.co
Phone: 3214582098
3105856930
Topics
Arreglos y ciclos
• Presentación / Presentation
• Ejercicios / Exercises
Presentation
Ejercicios en JAVA con para hacer uso de ciclos y arreglos
unidimensionales (Vectores).
A continuación crearemos software con el lenguaje JAVA que resuelva diversas
problemáticas, donde dichas problemáticas las abordaremos usando
ARREGLOS UNIDIMENSIONALES (VECTORES) y CICLOS (FOR /WHILE).
To practice!
P2Txx: vector with its indices
create a JAVA software that:
Automatically create an array of 10 randomly generated number positions between 1 and 100.
Additionally, you can view them on the screen including your index and the value to which it
corresponds.
Note: Use methods (f_menu, f_make_array, f_show_array)
Construir un programa en JAVA que,
Cree automáticamente un arreglo (vector) de 10 posiciones de números generados aleatoriamente
entre 1 y 100. Adicionalmente los visualice en pantalla incluyendo su índice y el valor al que
corresponde.
Nota: Utilice métodos (f_menu, f_crear_arreglo, f_visualizar_arreglo)
P2Txx: Vector_number_multiple_of_five
create a JAVA software that:
Automatically create an array (vector) of N positions with random numbers between 1 and 50.
In addition, display only numbers that are divisible by 5, for the above use methods (f_menu, f_create
array, f_ multiple_five).
Construir un programa en JAVA que,
Cree automáticamente un arreglo (vector) de N posiciones con números randomicos entre 1 y 50.
Adicionalmente que visualice únicamente los números que sean divisibles por 5, para lo anterior use
métodos (f_menu, f_crear_arreglo, f_ver_multiplos_cinco).
P2Txx: Vector with age of N people.
create a JAVA software that:
Generates the age randomly for N people and save them in a vector, with this information:
• determine how many are over 18 and when they are under.
• Those who are over 60 years old.
• Average age.
Construir un programa en JAVA que,
Genere la edad de forma aleatoria para N personas y las guarde en un vector, con esta información:
• determinar cuantos son mayores de 18 años y cuando son menores.
• Cuantos tienen más de 60 años.
• Promedio de edad.
P2Txx: Vector with price of N products
create a JAVA software that:
Automatically generate a vector of 10 random numbers between 1 and 10 (the number cannot be repeated), then
ask the user to enter a number, if the value entered is in the vector you will display a message that says
"Congratulations, you’ve won 1,000,000 pesos", after four failed attempts the software will display a message that
says "Sorry you have lost your chance".
For this exercise, use the while cycle and methods for the processes.
Construir un programa en JAVA que,
Genere automáticamente un vector de 10 números aleatorios entre 1 y 10 (el número no se puede repetir),
después solicite al usuario que ingrese un número, si el valor ingresado esta en el vector le visualizara un mensaje
que diga “Felicitaciones usted ha ganado 1.000.000 de pesos”, si después de cuatro(4) oportunidades no logra
adivinar el software le visualizara un mensaje que diga “Lo siento usted ha perdido su oportunidad”.
Para este ejercicio utilice el ciclo while y métodos para los procesos.
P2Txx: winning_number_machine
create a JAVA software that:
Automatically generate a vector of 10 random numbers between 1 and 10 (the number cannot be repeated), then
ask the user to enter a number, if the value entered is in the vector you will display a message that says
"Congratulations, you’ve won 1,000,000 pesos", after four failed attempts the software will display a message that
says "Sorry you have lost your chance".
For this exercise, use the while cycle and methods for the processes.
Construir un programa en JAVA que,
Genere automáticamente un vector de 10 números aleatorios entre 1 y 10 (el número no se puede repetir),
después solicite al usuario que ingrese un número, si el valor ingresado esta en el vector le visualizara un mensaje
que diga “Felicitaciones usted ha ganado 1.000.000 de pesos”, si después de cuatro(4) oportunidades no logra
adivinar el software le visualizara un mensaje que diga “Lo siento usted ha perdido su oportunidad”.
Para este ejercicio utilice el ciclo while y métodos para los procesos.
P2Txx: words_and_ascii
create a JAVA software that:
Ask the user to enter a word of at least 6 characters by keyboard, the software must convert that word into a string
array, and then display each letter with its respective ASCII code on the screen.
Construir un programa en JAVA que,
Pida al usuario ingresar por teclado una palabra de mínimo 6 caracteres, el software debe convertir esa palabra en
un arreglo tipo string, y luego visualizar en pantalla cada letra con su respectivo código ASCII.
P2Txx: two_vector_same
create a JAVA software that:
Automatically create two 50-position arrays with random numbers between 1 and 100 (numbers cannot be
repeated in the same vector). The software must traverse the two vectors and determine which numbers are
repeated and display them on the screen.
Construir un programa en JAVA que,
Cree automáticamente dos arreglos de 50 posiciones con números aleatorios entre 1 y 100 (no se pueden repetir
los números en el mismo vector). El software debe recorrer los dos vectores y determine cuales números están
repetidos y visualizarlos en pantalla.
P2Txx: mens_and_womens_ages
create a JAVA software that:
Automatically create two arrangements with 100 positions (one for women and one for men) in each vector will save the ages
that will be generated randomly between 1 and 100. The software should display how many:
• men and women are under the age of 18.
• men and women are equal to or over 18 but under 60.
• Men and women equal or over 60 years of age.
• Average age of women and men.
Construir un programa en JAVA que,
Cree automáticamente dos arreglos con 100 posiciones (uno para mujeres y otro para hombre) en cada vector se guardaran las
edades que se generaran de forma aleatoria entre 1 y 100. El software debe visualizar cuantos:
• hombres y mujeres son menores de 18 años.
• hombres y mujeres son iguales o mayores de 18 años pero menores de 60.
• Hombre y mujeres iguales o superan los 60 años de edad.
• Promedio de edad de mujeres y de hombres.
P2Txx: mens_and_womens_ages
create a JAVA software that:
Automatically create two arrangements with 100 positions (one for women and one for men) in each vector will save the ages
that will be generated randomly between 1 and 100. The software should display how many:
• men and women are under the age of 18.
• men and women are equal to or over 18 but under 60.
• Men and women equal or over 60 years of age.
• Average age of women and men.
Construir un programa en JAVA que,
Cree automáticamente dos arreglos con 100 posiciones (uno para mujeres y otro para hombre) en cada vector se guardaran las
edades que se generaran de forma aleatoria entre 1 y 100. El software debe visualizar cuantos:
• hombres y mujeres son menores de 18 años.
• hombres y mujeres son iguales o mayores de 18 años pero menores de 60.
• Hombre y mujeres iguales o superan los 60 años de edad.
• Promedio de edad de mujeres y de hombres.
P2Txx: delete_below_that_average
create a JAVA software that:
Automatically create an array with 20 positions (the value of each position will be a random number between 100
and 200). The software should calculate what is the average of generated values and clear all the values that are
below that average.
Note: you should display the original array, average and resulting array
Construir un programa en JAVA que,
Cree automáticamente un array con 20 posiciones (el valor de cada posición será un número aleatorio entre 100 y
200). El software debe calcular cual es el promedio de entre los valores generados y borrar todos los valores que
este por debajo de ese promedio.
Nota: debe visualizar el array original, el promedio y el array resultante
P2Txx: arrays_with_capiquaus
create a JAVA software that:
Automatically create an array with N positions (the value is typed by the user). The software must generate random
values between 1000 to 10000 to fill the array (numbers cannot be repeated). Additionally, you must indicate
which numbers are capiquaus (reads the same regardless of address).
Construir un programa en JAVA que,
Cree automáticamente un array con N posiciones(el valor es ingresado por el usuario). El software debe generar
valores aleatorios entre 1000 a 10000 para llenar el array (no se pueden repetir los números). Adicionalmente debe
indicar que números son capicuas (se lee igual sin importar la dirección).
P2Txx: arrays_repeated
create a JAVA software that:
Automatically create an array with N positions (the value is typed by the user). The software must generate random
values between 2 to 2222 to fill the array. In addition, you should display the average number on the screen and
display the elements of the array and in front of each value show the number of times that value is repeated in the
array.
Construir un programa en JAVA que,
Cree automáticamente un array con N posiciones (el valor es tecleado por el usuario). El software debe generar
valores aleatorios entre 2 a 2222 para llenar el array. Adicionalmente debe visualizar en la pantalla el promedio de
los números y visualizar los elementos del array y en frente de cada valor mostrar la cantidad de veces que se
repite ese valor en el array.
P2Txx: Hangman’s
create a JAVA software that:
Design the hangman's game with 10 different words (saved in a vector) of at least 4 characters, the software must randomly select
one of them and generate on screen a menu where stripes are displayed for each position of the letters.
The software requested that the user enter a letter, if the letter matches should be displayed on the screen.
The user can only fail 4 times otherwise it will generate a message saying "You have lost"
Construir un programa en JAVA que,
Diseñar el juego del ahorcado con 10 palabras diferentes (guardadas en un vector) de mínimo 4 caracteres, el software debe
seleccionar una de ellas aleatoriamente y generarle en pantalla un menú donde se visualicen rayas por cada posición de la letras.
El software pedida que el usuario ingrese una letra, si la letra coincide debe mostrarse en pantalla.
El usuario solo puede fallar 4 veces de lo contrario le generara un mensaje diciendo “Usted ha perdido”
Conceptos básicos
Ciclos
Métodos
Arreglos
Operaciones arreglos
matrices
persistencia
crud
Proyecto
JAVA arreglos unidimensionales y ciclos (FOR / WHILE)

Más contenido relacionado

Similar a JAVA arreglos unidimensionales y ciclos (FOR / WHILE)

Similar a JAVA arreglos unidimensionales y ciclos (FOR / WHILE) (20)

Metodos numericos s14
Metodos numericos s14Metodos numericos s14
Metodos numericos s14
 
Metodos numericos s14
Metodos numericos s14Metodos numericos s14
Metodos numericos s14
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
Trabajo grupal de ciclos repetitivos
Trabajo grupal de ciclos repetitivosTrabajo grupal de ciclos repetitivos
Trabajo grupal de ciclos repetitivos
 
Labo for while
Labo for whileLabo for while
Labo for while
 
Lab 3 while for compiladores e interpretes
Lab 3 while for  compiladores e interpretesLab 3 while for  compiladores e interpretes
Lab 3 while for compiladores e interpretes
 
Ejercicios 7 programación
Ejercicios 7 programaciónEjercicios 7 programación
Ejercicios 7 programación
 
Ejercicos 3 con fundamentacion
Ejercicos 3 con fundamentacionEjercicos 3 con fundamentacion
Ejercicos 3 con fundamentacion
 
Compiladores e-interprete
Compiladores e-interprete Compiladores e-interprete
Compiladores e-interprete
 
B05
B05B05
B05
 
B05
B05B05
B05
 
B05
B05B05
B05
 
B05
B05B05
B05
 
Guía de Ejercicios de Programación Web Básica
Guía de Ejercicios de Programación Web BásicaGuía de Ejercicios de Programación Web Básica
Guía de Ejercicios de Programación Web Básica
 
Guía De Ejercicios Programación Web Básica
Guía De Ejercicios Programación Web BásicaGuía De Ejercicios Programación Web Básica
Guía De Ejercicios Programación Web Básica
 
Introducción a JavaScript 1
Introducción a JavaScript 1Introducción a JavaScript 1
Introducción a JavaScript 1
 
Variables
VariablesVariables
Variables
 
Ejercicios de python
Ejercicios de pythonEjercicios de python
Ejercicios de python
 
Trabajo de arreglo
Trabajo de arregloTrabajo de arreglo
Trabajo de arreglo
 
Ejercicios java
Ejercicios javaEjercicios java
Ejercicios java
 

Último

ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...JAVIER SOLIS NOYOLA
 
La Función tecnológica del tutor.pptx
La  Función  tecnológica  del tutor.pptxLa  Función  tecnológica  del tutor.pptx
La Función tecnológica del tutor.pptxJunkotantik
 
Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...Lourdes Feria
 
DECÁGOLO DEL GENERAL ELOY ALFARO DELGADO
DECÁGOLO DEL GENERAL ELOY ALFARO DELGADODECÁGOLO DEL GENERAL ELOY ALFARO DELGADO
DECÁGOLO DEL GENERAL ELOY ALFARO DELGADOJosé Luis Palma
 
Resolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdf
Resolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdfResolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdf
Resolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdfDemetrio Ccesa Rayme
 
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdfPlanificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdfDemetrio Ccesa Rayme
 
el CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyz
el CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyzel CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyz
el CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyzprofefilete
 
Lecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdadLecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdadAlejandrino Halire Ccahuana
 
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxzulyvero07
 
MAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grandeMAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grandeMarjorie Burga
 
Registro Auxiliar - Primaria 2024 (1).pptx
Registro Auxiliar - Primaria  2024 (1).pptxRegistro Auxiliar - Primaria  2024 (1).pptx
Registro Auxiliar - Primaria 2024 (1).pptxFelicitasAsuncionDia
 
30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdfgimenanahuel
 
TIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptx
TIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptxTIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptx
TIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptxlclcarmen
 
CALENDARIZACION DE MAYO / RESPONSABILIDAD
CALENDARIZACION DE MAYO / RESPONSABILIDADCALENDARIZACION DE MAYO / RESPONSABILIDAD
CALENDARIZACION DE MAYO / RESPONSABILIDADauxsoporte
 
DE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.ppt
DE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.pptDE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.ppt
DE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.pptELENA GALLARDO PAÚLS
 

Último (20)

ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
ACERTIJO DE LA BANDERA OLÍMPICA CON ECUACIONES DE LA CIRCUNFERENCIA. Por JAVI...
 
La Función tecnológica del tutor.pptx
La  Función  tecnológica  del tutor.pptxLa  Función  tecnológica  del tutor.pptx
La Función tecnológica del tutor.pptx
 
Repaso Pruebas CRECE PR 2024. Ciencia General
Repaso Pruebas CRECE PR 2024. Ciencia GeneralRepaso Pruebas CRECE PR 2024. Ciencia General
Repaso Pruebas CRECE PR 2024. Ciencia General
 
Power Point: "Defendamos la verdad".pptx
Power Point: "Defendamos la verdad".pptxPower Point: "Defendamos la verdad".pptx
Power Point: "Defendamos la verdad".pptx
 
Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...
 
DECÁGOLO DEL GENERAL ELOY ALFARO DELGADO
DECÁGOLO DEL GENERAL ELOY ALFARO DELGADODECÁGOLO DEL GENERAL ELOY ALFARO DELGADO
DECÁGOLO DEL GENERAL ELOY ALFARO DELGADO
 
Resolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdf
Resolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdfResolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdf
Resolucion de Problemas en Educacion Inicial 5 años ED-2024 Ccesa007.pdf
 
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdfPlanificacion Anual 2do Grado Educacion Primaria   2024   Ccesa007.pdf
Planificacion Anual 2do Grado Educacion Primaria 2024 Ccesa007.pdf
 
el CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyz
el CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyzel CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyz
el CTE 6 DOCENTES 2 2023-2024abcdefghijoklmnñopqrstuvwxyz
 
La Trampa De La Felicidad. Russ-Harris.pdf
La Trampa De La Felicidad. Russ-Harris.pdfLa Trampa De La Felicidad. Russ-Harris.pdf
La Trampa De La Felicidad. Russ-Harris.pdf
 
Lecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdadLecciones 04 Esc. Sabática. Defendamos la verdad
Lecciones 04 Esc. Sabática. Defendamos la verdad
 
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptxACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
ACUERDO MINISTERIAL 078-ORGANISMOS ESCOLARES..pptx
 
MAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grandeMAYO 1 PROYECTO día de la madre el amor más grande
MAYO 1 PROYECTO día de la madre el amor más grande
 
Presentacion Metodología de Enseñanza Multigrado
Presentacion Metodología de Enseñanza MultigradoPresentacion Metodología de Enseñanza Multigrado
Presentacion Metodología de Enseñanza Multigrado
 
Registro Auxiliar - Primaria 2024 (1).pptx
Registro Auxiliar - Primaria  2024 (1).pptxRegistro Auxiliar - Primaria  2024 (1).pptx
Registro Auxiliar - Primaria 2024 (1).pptx
 
30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf30-de-abril-plebiscito-1902_240420_104511.pdf
30-de-abril-plebiscito-1902_240420_104511.pdf
 
TIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptx
TIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptxTIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptx
TIPOLOGÍA TEXTUAL- EXPOSICIÓN Y ARGUMENTACIÓN.pptx
 
Sesión de clase: Defendamos la verdad.pdf
Sesión de clase: Defendamos la verdad.pdfSesión de clase: Defendamos la verdad.pdf
Sesión de clase: Defendamos la verdad.pdf
 
CALENDARIZACION DE MAYO / RESPONSABILIDAD
CALENDARIZACION DE MAYO / RESPONSABILIDADCALENDARIZACION DE MAYO / RESPONSABILIDAD
CALENDARIZACION DE MAYO / RESPONSABILIDAD
 
DE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.ppt
DE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.pptDE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.ppt
DE LAS OLIMPIADAS GRIEGAS A LAS DEL MUNDO MODERNO.ppt
 

JAVA arreglos unidimensionales y ciclos (FOR / WHILE)

  • 1.
  • 2. Faculty: Systems engineer Course: Introduction of Programming Topic: vectores y arreglos ________________________________________________ Socializer: Luis Fernando Castellanos Guarín Karen Daniela Cuervo Cely Email: Luis.castellanosg@usantoto.edu.co Karen.cuervo@usantoto.edu.co Phone: 3214582098 3105856930
  • 3. Topics Arreglos y ciclos • Presentación / Presentation • Ejercicios / Exercises
  • 4. Presentation Ejercicios en JAVA con para hacer uso de ciclos y arreglos unidimensionales (Vectores). A continuación crearemos software con el lenguaje JAVA que resuelva diversas problemáticas, donde dichas problemáticas las abordaremos usando ARREGLOS UNIDIMENSIONALES (VECTORES) y CICLOS (FOR /WHILE).
  • 6. P2Txx: vector with its indices create a JAVA software that: Automatically create an array of 10 randomly generated number positions between 1 and 100. Additionally, you can view them on the screen including your index and the value to which it corresponds. Note: Use methods (f_menu, f_make_array, f_show_array) Construir un programa en JAVA que, Cree automáticamente un arreglo (vector) de 10 posiciones de números generados aleatoriamente entre 1 y 100. Adicionalmente los visualice en pantalla incluyendo su índice y el valor al que corresponde. Nota: Utilice métodos (f_menu, f_crear_arreglo, f_visualizar_arreglo)
  • 7. P2Txx: Vector_number_multiple_of_five create a JAVA software that: Automatically create an array (vector) of N positions with random numbers between 1 and 50. In addition, display only numbers that are divisible by 5, for the above use methods (f_menu, f_create array, f_ multiple_five). Construir un programa en JAVA que, Cree automáticamente un arreglo (vector) de N posiciones con números randomicos entre 1 y 50. Adicionalmente que visualice únicamente los números que sean divisibles por 5, para lo anterior use métodos (f_menu, f_crear_arreglo, f_ver_multiplos_cinco).
  • 8. P2Txx: Vector with age of N people. create a JAVA software that: Generates the age randomly for N people and save them in a vector, with this information: • determine how many are over 18 and when they are under. • Those who are over 60 years old. • Average age. Construir un programa en JAVA que, Genere la edad de forma aleatoria para N personas y las guarde en un vector, con esta información: • determinar cuantos son mayores de 18 años y cuando son menores. • Cuantos tienen más de 60 años. • Promedio de edad.
  • 9. P2Txx: Vector with price of N products create a JAVA software that: Automatically generate a vector of 10 random numbers between 1 and 10 (the number cannot be repeated), then ask the user to enter a number, if the value entered is in the vector you will display a message that says "Congratulations, you’ve won 1,000,000 pesos", after four failed attempts the software will display a message that says "Sorry you have lost your chance". For this exercise, use the while cycle and methods for the processes. Construir un programa en JAVA que, Genere automáticamente un vector de 10 números aleatorios entre 1 y 10 (el número no se puede repetir), después solicite al usuario que ingrese un número, si el valor ingresado esta en el vector le visualizara un mensaje que diga “Felicitaciones usted ha ganado 1.000.000 de pesos”, si después de cuatro(4) oportunidades no logra adivinar el software le visualizara un mensaje que diga “Lo siento usted ha perdido su oportunidad”. Para este ejercicio utilice el ciclo while y métodos para los procesos.
  • 10. P2Txx: winning_number_machine create a JAVA software that: Automatically generate a vector of 10 random numbers between 1 and 10 (the number cannot be repeated), then ask the user to enter a number, if the value entered is in the vector you will display a message that says "Congratulations, you’ve won 1,000,000 pesos", after four failed attempts the software will display a message that says "Sorry you have lost your chance". For this exercise, use the while cycle and methods for the processes. Construir un programa en JAVA que, Genere automáticamente un vector de 10 números aleatorios entre 1 y 10 (el número no se puede repetir), después solicite al usuario que ingrese un número, si el valor ingresado esta en el vector le visualizara un mensaje que diga “Felicitaciones usted ha ganado 1.000.000 de pesos”, si después de cuatro(4) oportunidades no logra adivinar el software le visualizara un mensaje que diga “Lo siento usted ha perdido su oportunidad”. Para este ejercicio utilice el ciclo while y métodos para los procesos.
  • 11. P2Txx: words_and_ascii create a JAVA software that: Ask the user to enter a word of at least 6 characters by keyboard, the software must convert that word into a string array, and then display each letter with its respective ASCII code on the screen. Construir un programa en JAVA que, Pida al usuario ingresar por teclado una palabra de mínimo 6 caracteres, el software debe convertir esa palabra en un arreglo tipo string, y luego visualizar en pantalla cada letra con su respectivo código ASCII.
  • 12. P2Txx: two_vector_same create a JAVA software that: Automatically create two 50-position arrays with random numbers between 1 and 100 (numbers cannot be repeated in the same vector). The software must traverse the two vectors and determine which numbers are repeated and display them on the screen. Construir un programa en JAVA que, Cree automáticamente dos arreglos de 50 posiciones con números aleatorios entre 1 y 100 (no se pueden repetir los números en el mismo vector). El software debe recorrer los dos vectores y determine cuales números están repetidos y visualizarlos en pantalla.
  • 13. P2Txx: mens_and_womens_ages create a JAVA software that: Automatically create two arrangements with 100 positions (one for women and one for men) in each vector will save the ages that will be generated randomly between 1 and 100. The software should display how many: • men and women are under the age of 18. • men and women are equal to or over 18 but under 60. • Men and women equal or over 60 years of age. • Average age of women and men. Construir un programa en JAVA que, Cree automáticamente dos arreglos con 100 posiciones (uno para mujeres y otro para hombre) en cada vector se guardaran las edades que se generaran de forma aleatoria entre 1 y 100. El software debe visualizar cuantos: • hombres y mujeres son menores de 18 años. • hombres y mujeres son iguales o mayores de 18 años pero menores de 60. • Hombre y mujeres iguales o superan los 60 años de edad. • Promedio de edad de mujeres y de hombres.
  • 14. P2Txx: mens_and_womens_ages create a JAVA software that: Automatically create two arrangements with 100 positions (one for women and one for men) in each vector will save the ages that will be generated randomly between 1 and 100. The software should display how many: • men and women are under the age of 18. • men and women are equal to or over 18 but under 60. • Men and women equal or over 60 years of age. • Average age of women and men. Construir un programa en JAVA que, Cree automáticamente dos arreglos con 100 posiciones (uno para mujeres y otro para hombre) en cada vector se guardaran las edades que se generaran de forma aleatoria entre 1 y 100. El software debe visualizar cuantos: • hombres y mujeres son menores de 18 años. • hombres y mujeres son iguales o mayores de 18 años pero menores de 60. • Hombre y mujeres iguales o superan los 60 años de edad. • Promedio de edad de mujeres y de hombres.
  • 15. P2Txx: delete_below_that_average create a JAVA software that: Automatically create an array with 20 positions (the value of each position will be a random number between 100 and 200). The software should calculate what is the average of generated values and clear all the values that are below that average. Note: you should display the original array, average and resulting array Construir un programa en JAVA que, Cree automáticamente un array con 20 posiciones (el valor de cada posición será un número aleatorio entre 100 y 200). El software debe calcular cual es el promedio de entre los valores generados y borrar todos los valores que este por debajo de ese promedio. Nota: debe visualizar el array original, el promedio y el array resultante
  • 16. P2Txx: arrays_with_capiquaus create a JAVA software that: Automatically create an array with N positions (the value is typed by the user). The software must generate random values between 1000 to 10000 to fill the array (numbers cannot be repeated). Additionally, you must indicate which numbers are capiquaus (reads the same regardless of address). Construir un programa en JAVA que, Cree automáticamente un array con N posiciones(el valor es ingresado por el usuario). El software debe generar valores aleatorios entre 1000 a 10000 para llenar el array (no se pueden repetir los números). Adicionalmente debe indicar que números son capicuas (se lee igual sin importar la dirección).
  • 17. P2Txx: arrays_repeated create a JAVA software that: Automatically create an array with N positions (the value is typed by the user). The software must generate random values between 2 to 2222 to fill the array. In addition, you should display the average number on the screen and display the elements of the array and in front of each value show the number of times that value is repeated in the array. Construir un programa en JAVA que, Cree automáticamente un array con N posiciones (el valor es tecleado por el usuario). El software debe generar valores aleatorios entre 2 a 2222 para llenar el array. Adicionalmente debe visualizar en la pantalla el promedio de los números y visualizar los elementos del array y en frente de cada valor mostrar la cantidad de veces que se repite ese valor en el array.
  • 18. P2Txx: Hangman’s create a JAVA software that: Design the hangman's game with 10 different words (saved in a vector) of at least 4 characters, the software must randomly select one of them and generate on screen a menu where stripes are displayed for each position of the letters. The software requested that the user enter a letter, if the letter matches should be displayed on the screen. The user can only fail 4 times otherwise it will generate a message saying "You have lost" Construir un programa en JAVA que, Diseñar el juego del ahorcado con 10 palabras diferentes (guardadas en un vector) de mínimo 4 caracteres, el software debe seleccionar una de ellas aleatoriamente y generarle en pantalla un menú donde se visualicen rayas por cada posición de la letras. El software pedida que el usuario ingrese una letra, si la letra coincide debe mostrarse en pantalla. El usuario solo puede fallar 4 veces de lo contrario le generara un mensaje diciendo “Usted ha perdido”