Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Instrucciones
https://poli.instructure.com/courses/11283/quizzes/41100 1/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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)
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/11283/quizzes/41100 2/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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;
https://poli.instructure.com/courses/11283/quizzes/41100 3/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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
de!
e
e
d+e
de!
de
d
e
de
de
d2!
¡Correcto!
d
e
d+e
de
d2e!
Ejercicio de Compilación:
https://poli.instructure.com/courses/11283/quizzes/41100 4/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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;
¡Correcto!
a = 17 , b = 32
a = 32 , b = 17
a = 15 , b = 15
a = 49 , b = 32
a = 32 , b = 15
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 ;
https://poli.instructure.com/courses/11283/quizzes/41100 5/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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;
}
System.out.println(de);
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.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.02 para tp = 2 , tc = 1
https://poli.instructure.com/courses/11283/quizzes/41100 6/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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
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/11283/quizzes/41100 7/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
1
3
5
15
10
17
¡Correcto!
1
2
5
15
11
17
1
2
5
15
12
17
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/11283/quizzes/41100 8/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
if (i>j){
System.out.print (j+2);
}else{
if (i>=j){
System.out.print (i);
}else{
System.out.print ("");
System.out.println();
1
222
¡Correcto! 1
232
4
232
4
444
Ejercicio de Compilación:
1. Ingrese a eclipse.
https://poli.instructure.com/courses/11283/quizzes/41100 9/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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;
else {
else {
else {
System.out.println(cadena);
¡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.
https://poli.instructure.com/courses/11283/quizzes/41100 10/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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;
else {
else {
else {
System.out.println(cadena);
¡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.
Ejercicio de Compilación:
1. Ingrese a eclipse.
2. Cree un proyecto.
3. Cree una clase.
https://poli.instructure.com/courses/11283/quizzes/41100 12/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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);
true
true
true
true
true
false
https://poli.instructure.com/courses/11283/quizzes/41100 13/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
true
true
true
true
true
true
¡Correcto!
false
true
true
true
true
false
false
true
true
true
true
true
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=5;
int m = n * 2;
int i = 1;
while (i <= n) {
int j = 1;
while (j < m) {
if (j <= n)
else
} else {
j = j + 1;
System.out.println ();
i = i + 1;
1
01
-1 0 1
-2 -1 0 1
-3 -2 -1 0 1
¡Correcto! 123454321
1234321
12321
121
1
https://poli.instructure.com/courses/11283/quizzes/41100 15/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
123451
1234
12
1
10
1 0 -1
1 0 -1 -2
1 0 -1 -2 -3
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/11283/quizzes/41100 16/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
false
true
true
true
false
false
false
true
false
true
true
false
false
true
true
true
true
true
¡Correcto!
false
true
true
true
true
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){
https://poli.instructure.com/courses/11283/quizzes/41100 17/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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
¡Correcto!
hola
hola
true
false
f
f
false
hola_
hola
false
false
g
g
false
https://poli.instructure.com/courses/11283/quizzes/41100 18/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
hola
hola_
false
true
g
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 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/11283/quizzes/41100 19/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
2
3
6
15
11
17
1
3
5
15
10
17
1
2
5
15
12
17
¡Correcto!
1
2
5
15
11
17
https://poli.instructure.com/courses/11283/quizzes/41100 20/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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
3
5
15
10
17
2
3
6
15
11
17
https://poli.instructure.com/courses/11283/quizzes/41100 21/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
1
2
5
15
12
17
¡Correcto!
1
2
5
15
11
17
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);
https://poli.instructure.com/courses/11283/quizzes/41100 22/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
espuesta correcta 9
-0.92135647
34
Respondido
9 (9..9)
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";
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
https://poli.instructure.com/courses/11283/quizzes/41100 23/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
d
e
de
de
de!
¡Correcto!
d
e
d+e
de
d2e!
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)
https://poli.instructure.com/courses/11283/quizzes/41100 24/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
https://poli.instructure.com/courses/11283/quizzes/41100 25/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
¿Que librería debo llamar de primeras para tomar un dato por teclado?
import java.util.Screen;
import java.Scanner;
import java.util.Math;
String a = "hola";
String b = 'h' + "o" + 'l' + "a" + "";
boolean c = a.equals (b);
boolean e = !c;
char f = 'f';
https://poli.instructure.com/courses/11283/quizzes/41100 26/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
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
f
g
false
hola_
hola
false
false
g
g
false
¡Correcto!
hola
hola
true
false
f
f
false
https://poli.instructure.com/courses/11283/quizzes/41100 27/28
24/9/2019 Examen parcial - Semana 4: RA/PRIMER BLOQUE-PROGRAMACION DE COMPUTADORES-[GRUPO5]
https://poli.instructure.com/courses/11283/quizzes/41100 28/28