Sie sind auf Seite 1von 25

22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

Examen parcial - Semana 4

Fecha límite 24 de sep en 23:55 Puntos 75 Preguntas 20


Disponible 21 de sep en 0:00-24 de sep en 23:55 4 días Tiempo límite 90 minutos
Intentos permitidos 2

Instrucciones

https://poli.instructure.com/courses/11281/quizzes/41094 1/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

Volver a realizar la evaluación

Historial de intentos

Intento Tiempo Puntaje


ÚLTIMO Intento 1 63 minutos 75 de 75

Calificación para este intento: 75 de 75


Presentado 22 de sep en 13:38
Este intento tuvo una duración de 63 minutos.

Pregunta 1 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)

¿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);

https://poli.instructure.com/courses/11281/quizzes/41094 2/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

1.0
9.0
1.0
2
3
-1

3.0
11.0
1.0
2
3
-2

2.0
9.0
1.0
3
9
-2

¡Correcto!
0.0
9.0
3.0
2
9
-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){

https://poli.instructure.com/courses/11281/quizzes/41094 3/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

5. Declare variables ( DE SER NECESARIO)

¿Cuál es la salida del siguiente programa en JAVA?

for (int i=10;i>=0;i--){

System.out.println (i);

Error de compilación

1.0
9.0
1.0
2
3
-1

20
19
18
17
16
15
14
13
12
11
10

https://poli.instructure.com/courses/11281/quizzes/41094 4/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

¡Correcto! 10
9
8
7
6
5
4
3
2
1
0

Pregunta 3 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)

¿Cuál es la salida del siguiente programa en JAVA?

int n=2;

for (int i=1; i<=n; i++){

for (int j=n; j>=1; j--){

if (i>j){

System.out.print (j+2);

}else{

System.out.print (" ");

if (i>=j){

System.out.print (i);

https://poli.instructure.com/courses/11281/quizzes/41094 5/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

}else{

System.out.print ("");

System.out.println();

4
444

4
232

¡Correcto! 1
232

1
222

Pregunta 4 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)

¿Cuál es la salida del siguiente programa en JAVA?

int n=2;

for(int i = 1; i<=10; i++){

System.out.println(n + " * " + i + " = " + n*i);

https://poli.instructure.com/courses/11281/quizzes/41094 6/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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

¡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

https://poli.instructure.com/courses/11281/quizzes/41094 7/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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

Pregunta 5 3.75 / 3.75 ptos.

Cuál es la salida del siguiente programa en JAVA?

char i = 'd';
char j = 'e';
int n = 2;
String s = "d+e";
String t = "de";
String u = i + "" + n + j + "!";
https://poli.instructure.com/courses/11281/quizzes/41094 8/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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!

Pregunta 6 3.75 / 3.75 ptos.

Cuál es la salida del siguiente programa en JAVA?

int a = 1;
int b = 2;
int c = 5;
https://poli.instructure.com/courses/11281/quizzes/41094 9/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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

1
3
5
15
10
17

¡Correcto!
1
2
5
15
11
17

2
3
6
15
11
17

https://poli.instructure.com/courses/11281/quizzes/41094 10/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

Pregunta 7 3.75 / 3.75 ptos.

¿Cual es la manera correcta para tomar datos del teclado de tipo entero,
teniendo en cuenta que la variable que tomo para guardar mis datos es
teclado?

nombre_variable = teclado.nextLine();

nombre_variable = teclado();

¡Correcto!
nombre_variable = teclado.nextInt();

nombre_variable = teclado.nextDouble();

Pregunta 8 3.75 / 3.75 ptos.

¿Que tipo de operación realiza el % en Java ?

Multiplicación

¡Correcto!
Módulo

Resta

División

Pregunta 9 3.75 / 3.75 ptos.

Ejercicio de Compilación:

1. Ingrese a eclipse.
2. Cree un proyecto.

https://poli.instructure.com/courses/11281/quizzes/41094 11/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

3. Cree una clase.


4. Realize el encabezado public static void main (String[] args){
5. Declare variables ( DE SER NECESARIO)

¿Cuál es la salida del siguiente programa en JAVA?

Suponiendo que inicialmente a = 32 y b = 17 , cuáles son los valores de


a y b después de ejecutar las siguientes tres asignaciones en orden?

a = a + b;
b = a - b;
a = a - b;

a = 15 , b = 15

a = 32 , b = 15

a = 32 , b = 17

¡Correcto!
a = 17 , b = 32

a = 49 , b = 32

Pregunta 10 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)

¿Cuál es la salida del siguiente programa en JAVA?

int n=5;

int m = n * 2;

https://poli.instructure.com/courses/11281/quizzes/41094 12/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

int i = 1;

while (i <= n) {

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 (" ");

j = j + 1;

System.out.println ();

i = i + 1;

¡Correcto! 123454321
1234321
12321
121
1

1
01
-1 0 1
-2 -1 0 1
-3 -2 -1 0 1

https://poli.instructure.com/courses/11281/quizzes/41094 13/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

1
10
1 0 -1
1 0 -1 -2
1 0 -1 -2 -3

123451
1234
12

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)

¿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);

https://poli.instructure.com/courses/11281/quizzes/41094 14/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

3.0
11.0
1.0
2
3
-2

1.0
9.0
1.0
2
3
-1

¡Correcto!
0.0
9.0
3.0
2
9
-1

1.0
29.8
9.933333333333334
4
11

Pregunta 12 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++;

https://poli.instructure.com/courses/11281/quizzes/41094 15/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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);

2.0
9.0
1.0
3
9
-2

1.0
9.0
1.0
2
3
-1

¡Correcto!
0.0
9.0
3.0
2
9
-1

3.0
11.0
1.0
2
3
-2

https://poli.instructure.com/courses/11281/quizzes/41094 16/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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)

¿Cuál es la salida del siguiente programa en JAVA?

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

false
true
true
true
true
true

https://poli.instructure.com/courses/11281/quizzes/41094 17/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

¡Correcto!
false
true
true
true
true
false

false
true
false
true
true
false

Pregunta 14 3.75 / 3.75 ptos.

Cuál es la salida del siguiente programa en JAVA?

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 );

https://poli.instructure.com/courses/11281/quizzes/41094 18/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

hola
hola
false
false
f
g
false

¡Correcto!
hola
hola
true
false
f
f
false

hola_
hola
false
false
g
g
false

hola
hola_
false
true
g
f
false

Pregunta 15 3.75 / 3.75 ptos.

Llamamos expresión booleana a una expresión que solo tiene dos


valores posibles: verdadero (true) o falso (false).

https://poli.instructure.com/courses/11281/quizzes/41094 19/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

False

¡Correcto! True

Pregunta 16 3.75 / 3.75 ptos.

Cuál es la salida del siguiente programa en JAVA?

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
false
true
true
false

https://poli.instructure.com/courses/11281/quizzes/41094 20/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

¡Correcto!
false
true
true
true
true
false

false
true
true
true
false
false

Pregunta 17 3.75 / 3.75 ptos.

Cuál es la salida del siguiente programa en JAVA?

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);

¡Correcto!
false
true
true
true
true
false

https://poli.instructure.com/courses/11281/quizzes/41094 21/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

false
true
false
true
true
false

false
true
true
true
true
true

false
true
true
true
false
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)

¿Cuál es la salida del siguiente programa en JAVA?

int x=26750,r=0;

r+=x/10000;

x=x%10000;

https://poli.instructure.com/courses/11281/quizzes/41094 22/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

r+=x/1000;

x=x%1000;

r+=x/100;

x=x%100;

r+=x/10;

r+=x%10;

System.out.println(x);

90

130

180

¡Correcto! 50

Pregunta 19 3.75 / 3.75 ptos.

Cual es la sentencia correcta para imprimir texto en pantalla?

System.out.println ( Hola Mundo )

Ninguna de las anteriores

System out println " Hola Mundo"

¡Correcto! System.out.println("Hola Mundo");

Pregunta 20 3.75 / 3.75 ptos.

https://poli.instructure.com/courses/11281/quizzes/41094 23/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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)

¿Cuál es la salida del siguiente programa en JAVA?

int x=700;

String cadena = "";

if ((x / 100) % 2 == 0){

cadena = "O" + cadena;}

else {

cadena = "X" + cadena;}

if ((x % 100 / 10) % 2 == 0){

cadena = cadena + "O";}

else {

cadena = cadena + "X";}

if ((x % 100 % 10 / 1) % 2 == 0){

cadena = cadena + "O";}

else {

cadena = cadena + "X";}

System.out.println(cadena);

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.

https://poli.instructure.com/courses/11281/quizzes/41094 24/25
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO3]

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.

¡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.

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.

Calificación de la evaluación: 75 de 75

https://poli.instructure.com/courses/11281/quizzes/41094 25/25

Das könnte Ihnen auch gefallen