Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
int i = 1, j = 2, k = 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);
3.0
11.0
1.0
-2
2.0
9.0
1.0
3
9
-2
1.0
9.0
1.0
-1
0.0
9.0
3.0
-1
Pregunta 2
3.75 / 3.75 ptos.
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)
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);
180
90
50
130
Pregunta 3
3.75 / 3.75 ptos.
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?
3
6
Pregunta 4
3.75 / 3.75 ptos.
Cuál es la salida del siguiente programa en JAVA?
String a = "hola";
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
false
hola_
hola
false
false
false
hola
hola
true
false
false
hola
hola_
false
true
false
Pregunta 5
3.75 / 3.75 ptos.
La palabra reservada else se utiliza principalmente para:
Pregunta 6
3.75 / 3.75 ptos.
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;
a = 17 , b = 32
a = 32 , b = 15
a = 49 , b = 32
a = 32 , b = 17
a = 15 , b = 15
Pregunta 7
3.75 / 3.75 ptos.
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;
for(int i = 1; i<=10; i++){
System.out.println(n + " * " + i + " = " + n*i);
}
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
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
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
Pregunta 8
3.75 / 3.75 ptos.
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);
15
10
17
15
11
17
15
12
17
15
11
17
Pregunta 9
3.75 / 3.75 ptos.
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);
20
19
18
17
16
15
14
13
12
11
10
Error de compilación
1.0
9.0
1.0
-1
10
9
8
7
6
5
4
3
2
1
0
Pregunta 10
3.75 / 3.75 ptos.
Cual es la sentencia correcta para imprimir texto en pantalla?
System.out.println("Hola Mundo");
Pregunta 11
3.75 / 3.75 ptos.
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);
9 (9..9)
-0.92135647
34
Pregunta 12
3.75 / 3.75 ptos.
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)
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);
false
true
true
true
true
false
false
true
false
true
true
false
false
true
true
true
true
true
false
true
true
true
false
false
Pregunta 13
3.75 / 3.75 ptos.
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)
String a = "hola";
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
true
false
hola
hola
false
false
false
hola_
hola
false
false
false
hola
hola
true
false
f
f
false
Pregunta 14
3.75 / 3.75 ptos.
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";
String t = "de";
System.out.println (i);
System.out.println (j);
System.out.println (s);
System.out.println (t);
System.out.println (u);
d+e
de
d2e!
d
de
de
de!
de
de
d2!
d+e
de!
de
Pregunta 15
3.75 / 3.75 ptos.
Cuál es la salida del siguiente programa en JAVA?
String a = "hola";
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
true
false
false
hola
hola
false
false
false
hola
hola_
false
true
f
false
hola_
hola
false
false
false
Pregunta 16
3.75 / 3.75 ptos.
Cuál es la salida del siguiente programa en JAVA?
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);
15
11
17
15
11
17
15
12
17
15
10
17
Pregunta 17
3.75 / 3.75 ptos.
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)
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
false
false
true
true
true
true
true
true
true
true
true
true
true
true
true
true
true
true
false
Pregunta 18
3.75 / 3.75 ptos.
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);
15
10
17
15
11
17
15
11
17
15
12
17
Pregunta 19
3.75 / 3.75 ptos.
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";
String t = "de";
System.out.println (i);
System.out.println (j);
System.out.println (s);
System.out.println (t);
System.out.println (u);
d
d+e
de
d2e!
d+e
de!
de
de
de
de!
de
de
d2!
Pregunta 20
3.75 / 3.75 ptos.
Cuál es la salida del siguiente programa en JAVA?
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);
0.0
9.0
3.0
-1
1.0
9.0
1.0
-1
3.0
11.0
1.0
-2
2.0
9.0
1.0
-2
Calificación de la evaluación: 75 de 75