Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Instrucciones de la evaluación
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
https://poli.instructure.com/courses/6413/quizzes/26139/take 1/23
24/9/2018 Evaluación: Examen parcial - Semana 4
boolean a = false;
boolean b = true;
boolean c = !a;
boolean d = a || b;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (d);
System.out.println (e);
System.out.println (f);
true
true
true
true
true
false
true
true
true
true
true
true
https://poli.instructure.com/courses/6413/quizzes/26139/take 2/23
24/9/2018 Evaluación: Examen parcial - Semana 4
false
true
true
true
true
true
false
true
true
true
true
false
Llamamos expresión booleana a una expresión que solo tiene dos valores
posibles: verdadero (true) o falso (false).
False
True
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 {
j = j + 1;
System.out.println ();
i = i + 1;
123451
1234
12
123454321
1234321
12321
121
1
https://poli.instructure.com/courses/6413/quizzes/26139/take 4/23
24/9/2018 Evaluación: Examen parcial - Semana 4
1
10
1 0 -1
1 0 -1 -2
1 0 -1 -2 -3
1
01
-1 0 1
-2 -1 0 1
-3 -2 -1 0 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)
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);
https://poli.instructure.com/courses/6413/quizzes/26139/take 5/23
24/9/2018 Evaluación: Examen parcial - Semana 4
2.0
9.0
1.0
3
9
-2
0.0
9.0
3.0
2
9
-1
3.0
11.0
1.0
2
3
-2
1.0
9.0
1.0
2
3
-1
Multiplicación
Resta
Módulo
https://poli.instructure.com/courses/6413/quizzes/26139/take 6/23
24/9/2018 Evaluación: Examen parcial - Semana 4
División
String a = "hola";
String b = 'h' + "o" + 'l' + "a" + "";
boolean c = a.equals (b);
boolean e = !c;
char f = 'f';
char g = 'f';
boolean h = g != f;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (e);
System.out.println (f);
System.out.println (g);
System.out.println (h );
hola
hola
false
false
f
g
false
hola
hola_
false
true
g
f
false
https://poli.instructure.com/courses/6413/quizzes/26139/take 7/23
24/9/2018 Evaluación: Examen parcial - Semana 4
hola_
hola
false
false
g
g
false
hola
hola
true
false
f
f
false
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 x=700;
else {
https://poli.instructure.com/courses/6413/quizzes/26139/take 8/23
24/9/2018 Evaluación: Examen parcial - Semana 4
else {
else {
System.out.println(cadena);
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.
El programa genera una cadena compuesta de Z y N. Donde N representa los dígitos impares
de un número de 3 cifras y O representa los dígitos pares.
El programa genera una cadena compuesta de K y J. Donde J representa los dígitos impares de
un número de 3 cifras y O representa los dígitos pares.
El programa genera una cadena compuesta de P y Q. Donde P representa los dígitos impares
de un número de 3 cifras y O representa los dígitos pares.
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)
a = a + b;
b = a - b;
a = a - b;
https://poli.instructure.com/courses/6413/quizzes/26139/take 9/23
24/9/2018 Evaluación: Examen parcial - Semana 4
a = 15 , b = 15
a = 32 , b = 15
a = 32 , b = 17
a = 17 , b = 32
a = 49 , b = 32
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
3
5
15
10
17
1
2
5
15
12
17
https://poli.instructure.com/courses/6413/quizzes/26139/take 10/23
24/9/2018 Evaluación: Examen parcial - Semana 4
2
3
6
15
11
17
1
2
5
15
11
17
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
3
5
15
10
17
https://poli.instructure.com/courses/6413/quizzes/26139/take 11/23
24/9/2018 Evaluación: Examen parcial - Semana 4
2
3
6
15
11
17
1
2
5
15
11
17
1
2
5
15
12
17
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);
https://poli.instructure.com/courses/6413/quizzes/26139/take 12/23
24/9/2018 Evaluación: Examen parcial - Semana 4
0.0
9.0
3.0
2
9
-1
2.0
9.0
1.0
3
9
-2
1.0
9.0
1.0
2
3
-1
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.
4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)
https://poli.instructure.com/courses/6413/quizzes/26139/take 13/23
24/9/2018 Evaluación: Examen parcial - Semana 4
boolean a = false;
boolean b = true;
boolean c = !a;
boolean d = a || b;
boolean e = d || c && !a;
boolean f = true && !e;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (d);
System.out.println (e);
System.out.println (f);
false
true
true
true
true
true
false
true
true
true
true
false
false
true
true
true
false
false
false
true
false
true
true
false
https://poli.instructure.com/courses/6413/quizzes/26139/take 14/23
24/9/2018 Evaluación: Examen parcial - Semana 4
Cuál es el mínimo número de comparaciones ( < , > , <= , >= , == ,! = ) que sería
necesario realizar para encontrar el mayor entre cinco (5) números enteros?
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=2;
https://poli.instructure.com/courses/6413/quizzes/26139/take 15/23
24/9/2018 Evaluación: Examen parcial - Semana 4
2*1=2
2*2=4
2*3=6
2*4=8
2 * 5 = 10
2 * 6 = 12
2 * 7 = 14
2 * 8 = 16
2 * 9 = 18
2 * 10 = 20
4*1=4
4*2=8
4 * 3 = 12
4 * 4 = 16
4 * 5 = 20
4 * 6 = 24
4 * 7 = 28
4 * 8 = 32
4 * 9 = 36
4 * 10 = 40
1*1=1
2*2=4
3*3=9
4 * 4 = 16
5 * 5 = 25
6 * 6 = 36
7 * 7 = 49
8 * 8 = 64
9 * 9 = 81
10 * 10 = 100
https://poli.instructure.com/courses/6413/quizzes/26139/take 16/23
24/9/2018 Evaluación: Examen parcial - Semana 4
6*1=6
6 * 2 = 12
6 * 3 = 18
6 * 4 = 24
6 * 5 = 30
6 * 6 = 36
6 * 7 = 42
6 * 8 = 48
6 * 9 = 54
6 * 10 = 60
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 i = 1, j = 2, k = 0;
https://poli.instructure.com/courses/6413/quizzes/26139/take 17/23
24/9/2018 Evaluación: Examen parcial - Semana 4
1.0
9.0
1.0
2
3
-1
0.0
9.0
3.0
2
9
-1
1.0
29.8
9.933333333333334
4
11
3.0
11.0
1.0
2
3
-2
boolean a = false;
boolean b = true;
boolean c = !a;
boolean d = a || b;
boolean e = d || c && !a;
boolean f = true && !e;
System.out.println (a);
System.out.println (b);
System.out.println (c);
https://poli.instructure.com/courses/6413/quizzes/26139/take 18/23
24/9/2018 Evaluación: Examen parcial - Semana 4
System.out.println (d);
System.out.println (e);
System.out.println (f);
false
true
false
true
true
false
false
true
true
true
false
false
false
true
true
true
true
false
false
true
true
true
true
true
boolean a = false;
boolean b = true;
boolean c = !a;
https://poli.instructure.com/courses/6413/quizzes/26139/take 19/23
24/9/2018 Evaluación: Examen parcial - Semana 4
boolean d = a || b;
boolean e = d || c && !a;
boolean f = true && !e;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (d);
System.out.println (e);
System.out.println (f);
false
true
true
true
true
false
false
true
true
true
false
false
false
true
true
true
true
true
false
true
false
true
true
false
https://poli.instructure.com/courses/6413/quizzes/26139/take 20/23
24/9/2018 Evaluación: Examen parcial - Semana 4
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
d2!
e
e
d+e
de!
de
d
e
de
de
de!
d
e
d+e
de
d2e!
https://poli.instructure.com/courses/6413/quizzes/26139/take 21/23
24/9/2018 Evaluación: Examen parcial - Semana 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)
resultado=a * b;
200
30
308
500
109
String a = "hola";
String b = 'h' + "o" + 'l' + "a" + "";
boolean c = a.equals (b);
boolean e = !c;
char f = 'f';
char g = 'f';
boolean h = g != f;
System.out.println (a);
System.out.println (b);
System.out.println (c);
System.out.println (e);
System.out.println (f);
https://poli.instructure.com/courses/6413/quizzes/26139/take 22/23
24/9/2018 Evaluación: Examen parcial - Semana 4
System.out.println (g);
System.out.println (h );
hola
hola
false
false
f
g
false
hola
hola
true
false
f
f
false
hola_
hola
false
false
g
g
false
hola
hola_
false
true
g
f
false
https://poli.instructure.com/courses/6413/quizzes/26139/take 23/23