Escolar Documentos
Profissional Documentos
Cultura Documentos
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
resultado = 2;
}
else {
resultado = 1;
}
}
else {
resultado = 0;
}
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 1/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
False
¡Correcto!
True
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;
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 2/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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);
¡Correcto!
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
2.0
9.0
1.0
3
9
-2
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 3/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: 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);
¡Correcto!
d
e
d+e
de
d2e!
d
e
de
de
de!
e
e
d+e
de!
de
d
e
de
de
d2!
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 4/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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 );
¡Correcto!
hola
hola
true
false
f
f
false
hola_
hola
false
false
g
g
false
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 5/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
hola
hola_
false
true
g
f
false
hola
hola
false
false
f
g
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 i = 1, j = 2, k = 0;
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 6/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
System.out.println (i);
System.out.println (j);
System.out.println (k);
1.0
29.8
9.933333333333334
4
11
¡Correcto!
0.0
9.0
3.0
2
9
-1
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.
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 7/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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=26750,r=0;
r+=x/10000;
x=x%10000;
r+=x/1000;
x=x%1000;
/*
r+=x/100;
x=x%100;
*/
r+=x/10;
r+=x%10;
System.out.println(r);
33
¡Correcto! 83 (83..83)
23
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/11280/quizzes/41088/history?version=1 8/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
int n=2;
¡Correcto!
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
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 9/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: 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
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
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/11280/quizzes/41088/history?version=1 10/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: 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
false
false
¡Correcto!
false
true
true
true
true
false
false
true
false
true
true
false
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 11/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
false
true
true
true
true
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 x=26750,r=0;
r+=x/10000;
x=x%10000;
r+=x/1000;
x=x%1000;
r+=x/100;
x=x%100;
r+=x/10;
r+=x%10;
System.out.println(x);
¡Correcto! 50
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 12/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
90
130
180
¿Que librería debo llamar de primeras para tomar un dato por teclado?
import java.util.Math;
import java.Scanner;
import java.util.Screen;
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)
char i = 'd';
char j = 'e';
int n = 2;
String s = "d+e";
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 13/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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);
e
e
d+e
de!
de
¡Correcto!
d
e
d+e
de
d2e!
d
e
de
de
d2!
d
e
de
de
de!
Ejercicio de Compilación:
1. Ingrese a eclipse.
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 14/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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);
¡Correcto! 9
-0.92135647
9 (9..9)
34
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/11280/quizzes/41088/history?version=1 15/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: 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
¡Correcto!
false
true
true
true
true
false
false
true
false
true
true
false
false
true
true
true
false
false
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 16/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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 );
¡Correcto!
hola
hola
true
false
f
f
false
hola
hola
false
false
f
g
false
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 17/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
hola
hola_
false
true
g
f
false
hola_
hola
false
false
g
g
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 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);
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 18/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
System.out.println (e);
System.out.println (f);
1
3
5
15
10
17
¡Correcto!
1
2
5
15
11
17
2
3
6
15
11
17
1
2
5
15
12
17
Ejercicio de Compilación:
1. Ingrese a eclipse.
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 19/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
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 {
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/11280/quizzes/41088/history?version=1 20/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: 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)
a = a + b;
b = a - b;
a = a - b;
¡Correcto! a = 17 , b = 32
a = 32 , b = 17
a = 32 , b = 15
a = 49 , b = 32
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 21/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
a = 15 , b = 15
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);
¡Correcto!
1
2
5
15
11
17
1
3
5
15
10
17
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 22/23
22/9/2019 Historial de evaluaciones para Galeano Venegas Jairo Alexis: Examen parcial - Semana 4
2
3
6
15
11
17
1
2
5
15
12
17
División
Resta
¡Correcto!
Módulo
Multiplicación
Calificación de la evaluación: 75 de 75
https://poli.instructure.com/courses/11280/quizzes/41088/history?version=1 23/23