0% encontró este documento útil (0 votos)
180 vistas20 páginas

Examen Parcial - Semana 4

Este documento presenta un examen parcial sobre programación de computadores que consta de 20 preguntas y 75 puntos. Incluye 4 ejercicios de compilación con código Java y preguntas sobre la salida de dichos programas. El examen está disponible durante 4 días con un límite de tiempo de 90 minutos y se pueden realizar hasta 2 intentos.
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
0% encontró este documento útil (0 votos)
180 vistas20 páginas

Examen Parcial - Semana 4

Este documento presenta un examen parcial sobre programación de computadores que consta de 20 preguntas y 75 puntos. Incluye 4 ejercicios de compilación con código Java y preguntas sobre la salida de dichos programas. El examen está disponible durante 4 días con un límite de tiempo de 90 minutos y se pueden realizar hasta 2 intentos.
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
Está en la página 1/ 20

16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

Examen parcial - Semana 4


Fecha límite 16 abr en 23:59 Puntos 75 Preguntas 20
Disponible 13 abr en 0:00-16 abr en 23:59 4 días Tiempo límite 90 minutos
Intentos permitidos 2

Instrucciones

Volver a realizar la evaluación

https://poli.instructure.com/courses/4501/quizzes/18995 1/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

 Las respuestas correctas estarán disponibles del 16 abr en 23:59 al 17 abr en 23:59.

Calificación para este intento: 75 de 75


Presentado 16 abr en 0:44
Este intento tuvo una duración de 34 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?

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

https://poli.instructure.com/courses/4501/quizzes/18995 2/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

false
true
true
true
true
true

false
true
true
true
true
false

false
true
true
true
false
false

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)

¿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/4501/quizzes/18995 3/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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

1.0
29.8
9.933333333333334
4
11

0.0
9.0
3.0
2
9
-1

3.0
11.0
1.0
2
3
-2

Pregunta 3 3.75 / 3.75 ptos.

https://poli.instructure.com/courses/4501/quizzes/18995 4/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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

hola
hola_
false
true
g
f
false

hola
hola
true
false
f
f
false

hola_
hola
false
false
g
g
false

https://poli.instructure.com/courses/4501/quizzes/18995 5/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

hola
hola
false
false
f
g
false

Pregunta 4 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 + "!";
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!

d
e
d+e
de
d2e!

https://poli.instructure.com/courses/4501/quizzes/18995 6/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

e
e
d+e
de!
de

d
e
de
de
de!

Pregunta 5 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 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/4501/quizzes/18995 7/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

1
2
5
15
11
17

1
3
5
15
10
17

2
3
6
15
11
17

1
2
5
15
12
17

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)

https://poli.instructure.com/courses/4501/quizzes/18995 8/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

¿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 + "!";
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!

d
e
d+e
de
d2e!

e
e
d+e
de!
de

d
e
de
de
de!

Pregunta 7 3.75 / 3.75 ptos.

https://poli.instructure.com/courses/4501/quizzes/18995 9/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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

1
2
5
15
11
17

1
3
5
15
10
17

1
2
5
15
12
17

2
3
6
15
11
17

https://poli.instructure.com/courses/4501/quizzes/18995 10/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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)

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

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

83 (83..83)

33

23

Pregunta 9 3.75 / 3.75 ptos.

¿Que librería debo llamar de primeras para tomar un dato por teclado?

https://poli.instructure.com/courses/4501/quizzes/18995 11/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

import java.util.Scanner;

import java.Scanner;

import java.util.Math;

import java.util.Screen;

Pregunta 10 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.nextDouble();

nombre_variable = teclado.nextInt();

nombre_variable = teclado();

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?

https://poli.instructure.com/courses/4501/quizzes/18995 12/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

int n=2;

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

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

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/4501/quizzes/18995 13/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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

https://poli.instructure.com/courses/4501/quizzes/18995 14/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

System.out.println (b);
System.out.println (c);
System.out.println (d);
System.out.println (e);
System.out.println (f);

false
true
false
true
true
false

false
true
true
true
true
true

false
true
true
true
true
false

false
true
true
true
false
false

Pregunta 13 3.75 / 3.75 ptos.

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

https://poli.instructure.com/courses/4501/quizzes/18995 15/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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
d+e
de
d2e!

d
e
de
de
de!

d
e
de
de
d2!

e
e
d+e
de!
de

Pregunta 14 3.75 / 3.75 ptos.

https://poli.instructure.com/courses/4501/quizzes/18995 16/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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;

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 15 3.75 / 3.75 ptos.

Ejercicio de Compilación:

https://poli.instructure.com/courses/4501/quizzes/18995 17/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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?

Teniendo en cuenta que: a=28 b=11

resultado=a * b;

System.out.println("El resultado es"+resultado);

200

109

500

30

308

Pregunta 16 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?

https://poli.instructure.com/courses/4501/quizzes/18995 18/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

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 17 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/4501/quizzes/18995 19/20
16/4/2018 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO2]

hola_
hola
false
false
g
g
false

https://poli.instructure.com/courses/4501/quizzes/18995 20/20

También podría gustarte