Beruflich Dokumente
Kultur Dokumente
Instrucciones
https://poli.instructure.com/courses/8719/quizzes/33183 1/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
Historial de intentos
https://poli.instructure.com/courses/8719/quizzes/33183 2/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
Las respuestas correctas estarán disponibles del 10 de abr en 0:00 al 10 de abr en 23:55.
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);
2.0
9.0
1.0
3
9
-2
https://poli.instructure.com/courses/8719/quizzes/33183 3/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
3.0
11.0
1.0
2
3
-2
1.0
9.0
1.0
2
3
-1
0.0
9.0
3.0
2
9
-1
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=700;
https://poli.instructure.com/courses/8719/quizzes/33183 4/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
else {
else {
else {
System.out.println(cadena);
https://poli.instructure.com/courses/8719/quizzes/33183 5/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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;
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
https://poli.instructure.com/courses/8719/quizzes/33183 6/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
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
https://poli.instructure.com/courses/8719/quizzes/33183 7/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
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
https://poli.instructure.com/courses/8719/quizzes/33183 8/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
false
true
false
true
true
false
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)
boolean a = false;
boolean b = true;
boolean c = !a;
https://poli.instructure.com/courses/8719/quizzes/33183 9/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
false
true
true
true
false
false
false
true
true
true
true
false
false
true
true
true
true
true
https://poli.instructure.com/courses/8719/quizzes/33183 10/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
false
false
g
g
false
https://poli.instructure.com/courses/8719/quizzes/33183 11/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
hola
hola
false
false
f
g
false
hola
hola
true
false
f
f
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/8719/quizzes/33183 12/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
System.out.println (i);
System.out.println (j);
System.out.println (k);
1.0
29.8
9.933333333333334
4
11
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
¿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?
https://poli.instructure.com/courses/8719/quizzes/33183 13/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
nombre_variable = teclado.nextDouble();
nombre_variable = teclado.nextInt();
nombre_variable = teclado();
nombre_variable = teclado.nextLine();
https://poli.instructure.com/courses/8719/quizzes/33183 14/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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);
-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/8719/quizzes/33183 15/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
d2!
d
e
de
de
de!
e
e
d+e
de!
de
https://poli.instructure.com/courses/8719/quizzes/33183 16/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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 = 32 , b = 15
a = 32 , b = 17
a = 49 , b = 32
a = 17 , b = 32
a = 15 , b = 15
int a = 1;
int b = 2;
int c = 5;
int d = (a + b) * c;
int e = a + b * c;
https://poli.instructure.com/courses/8719/quizzes/33183 17/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
1
2
5
15
12
17
1
3
5
15
10
17
1
2
5
15
11
17
https://poli.instructure.com/courses/8719/quizzes/33183 18/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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/8719/quizzes/33183 19/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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)
tp = 1 , tc = 3 ;
tp = 2 , tc = 2 ;
tp = 3 , tc = 3 ;
tp = 2 , tc = 1 .
double de = 0.0;
if (tp == 1) {
de = 0.01;
}
else if (tp == 2) {
if (tc == 1)
de = 0.02;
else if (tc == 2)
de = 0.03;
else if (tc == 3)
de = 0.04;
} else {
de = 0.0;
https://poli.instructure.com/courses/8719/quizzes/33183 20/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
}
System.out.println(de);
de = 0.01 para tp = 1 , tc = 3
de = 0.02 para tp = 2 , tc = 2
de = 0.02 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.01 para tp = 1 , tc = 3
de = 0.03 para tp = 2 , tc = 2
de = 0.02 para tp = 3 , tc = 3
de = 0.01 para tp = 2 , tc = 1
de = 0.03 para tp = 1 , tc = 3
de = 0.01 para tp = 2 , tc = 2
de = 0.00 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.02 para tp = 1 , tc = 3
de = 0.01 para tp = 2 , tc = 2
de = 0.03 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.01 para tp = 1 , tc = 3
de = 0.03 para tp = 2 , tc = 2
de = 0.02 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
de = 0.01 para tp = 1 , tc = 3
de = 0.03 para tp = 2 , tc = 2
de = 0.00 para tp = 3 , tc = 3
de = 0.02 para tp = 2 , tc = 1
https://poli.instructure.com/courses/8719/quizzes/33183 21/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
False
True
División
Módulo
Resta
Multiplicación
System.out.println("Hola Mundo");
https://poli.instructure.com/courses/8719/quizzes/33183 22/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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)
resultado=a * b;
200
109
30
308
500
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/8719/quizzes/33183 23/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
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
true
true
true
false
false
true
false
true
true
false
https://poli.instructure.com/courses/8719/quizzes/33183 24/25
9/4/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO1]
false
true
true
true
false
false
Calificación de la evaluación: 75 de 75
https://poli.instructure.com/courses/8719/quizzes/33183 25/25