Академический Документы
Профессиональный Документы
Культура Документы
Quiz 2 - Semana 7
Instrucciones
https://poli.instructure.com/courses/11281/quizzes/41093 1/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
Historial de intentos
https://poli.instructure.com/courses/11281/quizzes/41093 2/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
Pregunta 1 9 / 9 ptos.
Relación de concurrencia
Relación directa
Relación redundante
Pregunta 2 9 / 9 ptos.
https://poli.instructure.com/courses/11281/quizzes/41093 3/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
https://poli.instructure.com/courses/11281/quizzes/41093 4/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
int a=2,i,n;
System.out.println("Ingrese numero");
n=sc.nextInt();
for(i=1;i<(n+1);i++){
if(n%i==0){
a++;
}
}
if(a!=3){
System.out.println("No es Primo");
}else{
System.out.println("Si es Primo");
}
Pregunta 3 9 / 9 ptos.
Para llenar un arreglo desde la primera posición del mismo, Cuál seria la
manera correcta de realizar nuestro ciclo for ?
¡Correcto!
for (int i=0;i<final;i++){
Pregunta 4 9 / 9 ptos.
https://poli.instructure.com/courses/11281/quizzes/41093 5/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
¡Correcto!
El programa genera una cadena compuesta de X y O donde X representa
los dígitos impares de un número de 3 cifras y O representa los dígitos
pares.
https://poli.instructure.com/courses/11281/quizzes/41093 6/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
Pregunta 5 9 / 9 ptos.
Súper Clase
Matrices
¡Correcto!
Método
Arreglo
Pregunta 6 9 / 9 ptos.
int m = n * 2;
int i = n;
while (i >= 1) {
int j = 1;
while (j < m) {
if (j >= i && j <= m - i) {
if (j <= n)
System.out.print (" " + (j - i + 1) + " ");
else
System.out.print (" " + (m - j - i + 1) + " ");
} else {
System.out.print (" ");
https://poli.instructure.com/courses/11281/quizzes/41093 7/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
}
j = j + 1;
}
System.out.println ();
i = i - 1;
}
1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1
1 1
2 2
3 3
4 4
5
4 4
3 3
2 2
1 1
1 2 3 4 5 4 3 2 1
2 2
3 3
4 4
5 5
4 4
3 3
2 2
1 2 3 4 5 4 3 2 1
¡Correcto!
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
https://poli.instructure.com/courses/11281/quizzes/41093 8/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
Pregunta 7 9 / 9 ptos.
System.out.println(Arreglo);
¡Correcto!
System.out.println(Arrays.toString(arreglo));
Pregunta 8 9 / 9 ptos.
False
¡Correcto!
True
Pregunta 9 9 / 9 ptos.
int m = n * 2;
int i = 1;
while (i < m) {
int j = 1;
while (j < m) {
if (i == 1 || i == m - 1) {
https://poli.instructure.com/courses/11281/quizzes/41093 9/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
if (j <= n)
System.out.print (" " + j + " ");
else
System.out.print (" " + (m - j) + " ");
} else if (j == 1 || j == m - 1) {
if (i <= n)
System.out.print (" " + i + " ");
else
System.out.print (" " + (m - i) + " ");
} else {
System.out.print (" ");
} j = j + 1;
}
System.out.println ();
i = i + 1;
}
1 2 3 4 5 4 3 2 1
1 2 3 4 3 2 1
1 2 3 2 1
1 2 1
1
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1
1 2 3 4 5 4 3 2 1
¡Correcto!
1 2 3 4 5 4 3 2 1
2 2
3 3
4 4
5 5
4 4
3 3
2 2
1 2 3 4 5 4 3 2 1
https://poli.instructure.com/courses/11281/quizzes/41093 10/11
15/10/2019 Quiz 2 - Semana 7: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]
1 1
2 2
3 3
4 4
5
4 4
3 3
2 2
1 1
Pregunta 10 9 / 9 ptos.
¡Correcto!
Cuando el programa se hace largo y complicado
¡Correcto!
Cuando se identifican tareas repetitivas en el código.
Calificación de la evaluación: 90 de 90
https://poli.instructure.com/courses/11281/quizzes/41093 11/11