Escolar Documentos
Profissional Documentos
Cultura Documentos
Instrucciones
https://poli.instructure.com/courses/11535/quizzes/41927 1/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
Historial de intentos
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);
1
2
5
15
12
17
https://poli.instructure.com/courses/11535/quizzes/41927 2/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
¡Correcto!
1
2
5
15
11
17
2
3
6
15
11
17
1
3
5
15
10
17
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/11535/quizzes/41927 3/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
hola
hola
false
false
f
g
false
hola_
hola
false
false
g
g
false
hola
hola_
false
true
g
f
false
¡Correcto!
hola
hola
true
false
f
f
false
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
https://poli.instructure.com/courses/11535/quizzes/41927 4/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
int x=700;
else {
else {
else {
System.out.println(cadena);
https://poli.instructure.com/courses/11535/quizzes/41927 5/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
¡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.
Respondido 3
espuesta correcta 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)
https://poli.instructure.com/courses/11535/quizzes/41927 6/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
https://poli.instructure.com/courses/11535/quizzes/41927 7/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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);
https://poli.instructure.com/courses/11535/quizzes/41927 8/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
¡Correcto!
d
e
d+e
de
d2e!
d
e
de
de
de!
e
e
d+e
de!
de
d
e
de
de
d2!
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/11535/quizzes/41927 9/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
if (i>j){
System.out.print (j+2);
}else{
if (i>=j){
System.out.print (i);
}else{
System.out.print ("");
System.out.println();
¡Correcto! 1
232
1
222
4
444
4
232
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
https://poli.instructure.com/courses/11535/quizzes/41927 10/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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
12
17
¡Correcto!
1
2
5
15
11
17
1
3
5
15
10
17
https://poli.instructure.com/courses/11535/quizzes/41927 11/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
2
3
6
15
11
17
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/11535/quizzes/41927 12/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
¡Correcto!
hola
hola
true
false
f
f
false
hola_
hola
false
false
g
g
false
¡Correcto!
Evitar que al cumplirse un caso, se evalúen los demás casos de la
secuencia.
https://poli.instructure.com/courses/11535/quizzes/41927 13/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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);
e
e
d+e
de!
de
d
e
de
de
de!
¡Correcto!
d
e
d+e
de
d2e!
d
e
de
de
d2!
https://poli.instructure.com/courses/11535/quizzes/41927 14/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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);
https://poli.instructure.com/courses/11535/quizzes/41927 15/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
false
true
false
true
true
false
false
true
true
true
true
true
¡Correcto!
false
true
true
true
true
false
false
true
true
true
false
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)
https://poli.instructure.com/courses/11535/quizzes/41927 16/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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
9 (9..9)
-0.92135647
34
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);
2
3
6
15
11
17
https://poli.instructure.com/courses/11535/quizzes/41927 17/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
1
2
5
15
12
17
¡Correcto!
1
2
5
15
11
17
1
3
5
15
10
17
¿Que librería debo llamar de primeras para tomar un dato por teclado?
import java.Scanner;
import java.util.Math;
import java.util.Screen;
https://poli.instructure.com/courses/11535/quizzes/41927 18/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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/11535/quizzes/41927 19/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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/11535/quizzes/41927 20/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
¡Correcto!
false
true
true
true
true
false
false
true
true
true
false
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;
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/11535/quizzes/41927 21/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
2.0
9.0
1.0
3
9
-2
¡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
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--;
https://poli.instructure.com/courses/11535/quizzes/41927 22/23
22/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO6]
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
3
-2
¡Correcto!
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
https://poli.instructure.com/courses/11535/quizzes/41927 23/23