Академический Документы
Профессиональный Документы
Культура Документы
Instrucciones
https://poli.instructure.com/courses/11282/quizzes/41096 1/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
Historial de intentos
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
int n=5;
int m = n * 2;
int i = 1;
while (i <= n) {
int j = 1;
while (j < m) {
if (j <= n)
else
} else {
https://poli.instructure.com/courses/11282/quizzes/41096 2/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
j = j + 1;
System.out.println ();
i = i + 1;
123451
1234
12
1
01
-1 0 1
-2 -1 0 1
-3 -2 -1 0 1
1
10
1 0 -1
1 0 -1 -2
1 0 -1 -2 -3
¡Correcto! 123454321
1234321
12321
121
1
int i = 1, j = 2, k = 0;
double x = 2.1, y = 4.5, z = 10.0;
x = i / 2;
y *= 2;
z = y / 3.0;
i++;
j += k + 5;
j += k + 2;
k--;
System.out.println (x);
System.out.println (y );
System.out.println (z);
https://poli.instructure.com/courses/11282/quizzes/41096 3/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
System.out.println (i);
System.out.println (j);
System.out.println (k);
1.0
9.0
1.0
2
3
-1
¡Correcto!
0.0
9.0
3.0
2
9
-1
2.0
9.0
1.0
3
9
-2
3.0
11.0
1.0
2
3
-2
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
https://poli.instructure.com/courses/11282/quizzes/41096 4/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
int x=700;
else {
else {
else {
System.out.println(cadena);
https://poli.instructure.com/courses/11282/quizzes/41096 5/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
¡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.
¡Correcto! 4
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
https://poli.instructure.com/courses/11282/quizzes/41096 6/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
int a = 1;
int b = 2;
int c = 5;
int d = (a + b) * c;
int e = a + b * c;
int f = 2 * a * a * + b * 3 + c;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (d);
System.out.println (e);
System.out.println (f);
1
2
5
15
12
17
¡Correcto!
1
2
5
15
11
17
1
3
5
15
10
17
2
3
6
15
11
17
https://poli.instructure.com/courses/11282/quizzes/41096 7/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
¡Correcto! Double
Decimales
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
int a = 1;
int b = 2;
int c = 5;
int d = (a + b) * c;
int e = a + b * c;
int f = 2 * a * a * + b * 3 + c;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (d);
System.out.println (e);
System.out.println (f);
https://poli.instructure.com/courses/11282/quizzes/41096 8/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
1
3
5
15
10
17
1
2
5
15
12
17
Respondido
2
3
6
15
11
17
espuesta correcta
1
2
5
15
11
17
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
resultado=a * b;
109
¡Correcto!
308
500
200
30
char i = 'd';
char j = 'e';
int n = 2;
String s = "d+e";
String t = "de";
String u = i + "" + n + j + "!";
System.out.println (i);
System.out.println (j);
System.out.println (s);
System.out.println (t);
System.out.println (u);
¡Correcto!
d
e
d+e
de
d2e!
https://poli.instructure.com/courses/11282/quizzes/41096 10/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
d
e
de
de
d2!
e
e
d+e
de!
de
d
e
de
de
de!
¡Correcto!
System.out.println("Hola Mundo");
Ejercicio de Compilación:
1. Ingrese a eclipse.
https://poli.instructure.com/courses/11282/quizzes/41096 11/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
https://poli.instructure.com/courses/11282/quizzes/41096 12/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
https://poli.instructure.com/courses/11282/quizzes/41096 13/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
int n=2;
if (i>j){
System.out.print (j+2);
}else{
if (i>=j){
System.out.print (i);
}else{
System.out.print ("");
System.out.println();
4
444
¡Correcto! 1
232
1
222
4
232
Ejercicio de Compilación:
1. Ingrese a eclipse.
https://poli.instructure.com/courses/11282/quizzes/41096 14/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
char i = 'd';
char j = 'e';
int n = 2;
String s = "d+e";
String t = "de";
String u = i + "" + n + j + "!";
System.out.println (i);
System.out.println (j);
System.out.println (s);
System.out.println (t);
System.out.println (u);
d
e
de
de
de!
¡Correcto!
d
e
d+e
de
d2e!
d
e
de
de
d2!
e
e
d+e
de!
de
https://poli.instructure.com/courses/11282/quizzes/41096 15/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
int r3=0;
int x=3;
float a=28.99f;
int b=6;
x=(int)a;
b--;
x=x % b * b % x - 6;
System.out.println(x);
-0.92135647
¡Correcto! 9
34
9 (9..9)
char i = 'd';
char j = 'e';
int n = 2;
String s = "d+e";
https://poli.instructure.com/courses/11282/quizzes/41096 16/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
String t = "de";
String u = i + "" + n + j + "!";
System.out.println (i);
System.out.println (j);
System.out.println (s);
System.out.println (t);
System.out.println (u);
d
e
de
de
de!
¡Correcto!
d
e
d+e
de
d2e!
e
e
d+e
de!
de
d
e
de
de
d2!
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
https://poli.instructure.com/courses/11282/quizzes/41096 17/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
int x=700;
else {
else {
else {
System.out.println(cadena);
¡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/11282/quizzes/41096 18/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
int i = 1, j = 2, k = 0;
double x = 2.1, y = 4.5, z = 10.0;
x = i / 2;
y *= 2;
z = y / 3.0;
i++;
j += k + 5;
j += k + 2;
k--;
System.out.println (x);
System.out.println (y );
System.out.println (z);
System.out.println (i);
System.out.println (j);
System.out.println (k);
1.0
9.0
1.0
2
3
-1
https://poli.instructure.com/courses/11282/quizzes/41096 19/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
3.0
11.0
1.0
2
3
-2
¡Correcto!
0.0
9.0
3.0
2
9
-1
2.0
9.0
1.0
3
9
-2
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
Suponga la siguiente porción de código donde existe una variable numero definida
previamente. Evalúe la ejecución con valores 3, 12, 18, 20, 22.
int resultado = 0;
if (numero % 2 == 0) {
if (numero % 4 == 0) {
if (numero % 6 == 0)
resultado = 3;
else
https://poli.instructure.com/courses/11282/quizzes/41096 20/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
resultado = 2;
}
else {
resultado = 1;
}
}
else {
resultado = 0;
}
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
https://poli.instructure.com/courses/11282/quizzes/41096 21/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
tp = 1 , tc = 3 ;
tp = 2 , tc = 2 ;
tp = 3 , tc = 3 ;
tp = 2 , tc = 1 .
double de = 0.0;
if (tp == 1) {
de = 0.01;
}
else if (tp == 2) {
if (tc == 1)
de = 0.02;
else if (tc == 2)
de = 0.03;
else if (tc == 3)
de = 0.04;
} else {
de = 0.0;
}
System.out.println(de);
de = 0.01 para tp = 1 , tc = 3
de = 0.02 para tp = 2 , tc = 2
de = 0.02 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.01 para tp = 1 , tc = 3
de = 0.03 para tp = 2 , tc = 2
de = 0.02 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.01 para tp = 1 , tc = 3
de = 0.03 para tp = 2 , tc = 2
de = 0.02 para tp = 3 , tc = 3
de = 0.01 para tp = 2 , tc = 1
https://poli.instructure.com/courses/11282/quizzes/41096 22/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
de = 0.02 para tp = 1 , tc = 3
de = 0.01 para tp = 2 , tc = 2
de = 0.03 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.03 para tp = 1 , tc = 3
de = 0.01 para tp = 2 , tc = 2
de = 0.00 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
System.out.println (i);
Error de compilación
https://poli.instructure.com/courses/11282/quizzes/41096 23/24
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO4]
20
19
18
17
16
15
14
13
12
11
10
¡Correcto! 10
9
8
7
6
5
4
3
2
1
0
1.0
9.0
1.0
2
3
-1
https://poli.instructure.com/courses/11282/quizzes/41096 24/24