Está en la página 1de 10

Universidad Autónoma de Baja California

Ingeniería, Arquitectura y Diseño

Arispe Martinez Misael

Grupo: 17

19 de Marzo de 2023

Metodología de la programación
Problemas del inciso “a)”

 Problema 1: 20 *((5 ** 3 * 2) ** 2) + ((10 / 2 – 3) * 10 div 2) – (50 mod 2)

Procedimiento:
20 *((25 * 6) ** 2) + ((5 – 3)* 10 div 2) – (0)
20 *((150)* 4) + ((2)* 10 div 2) – (0)
20 *(600) + ((2)* 5) – (0)
12000 + 10 – 0
12010

Resultado: 12010

Problemas del inciso “b)”

b): Si W, X, Y y Z son variables de tipo bolean con valores W = false, X = true, Y = true, Z = false, determina
el valor de las siguientes expresiones lógicas:

 Problema 1: W || Y && X && W || Z

Procedimiento:
false or true and true and false or false
true and false or false
false or false
false

Resultado: false
 Problema 2: X && !Y && !X || !W && Y

Procedimiento:
true && !true && !true || !false && true
true && no true && no true || no false && true
true && false && false || true && true
true and false and false or true and true
false and true and true
false and true
false

Resultado: false

 Problema 3: !(W || !Y) && X || Z

Procedimiento:
!(false || !true) && true || false
!(false || no true) && true || false
no(false or false) and true or false
no (false) and true or false
true and true or false
true or false
true

Resultado: true
 Problema 4: X && Y && W || Z || X

Procedimiento:
true && true && false || false || true
true and true and false or false or true
true and false or true
false or true
true

Resultado: true

 Problema 5: Y || !(Y || Z && W)

Procedimiento:
true || !(true || false && false)
true or no(true or false and false)
true or no(true and false)
true or no(false)
true or no(false)
true or true
true

Resultado: true
 Problema 6: !X && Y && (!Z || !X)

Problema:
!true && true && (!false || !true)
no true and true and (no false or true)
false and true and (true or true)
false and (true)
false

Resultado: false

Problemas del inciso “c)”

c): Escriba el resultado de las siguientes expresiones, considerando los valores


Para: a = 2, b = 3, c = 4, d = 5

 Problema 1: a + b * c / d

Procedimiento:
2+3*4/5
2 + 12 / 5
2 + 2.4
4.4

Resultado: 4.4
 Problema 2: a % 5 % 2 + c

Procedimiento:
2%5%2+4
2%5%2+4
2%2+4
0+4
4

Resultado: 4

 Problema 3: (a+b) * c % d

Procedimiento:
(2+3) * 4 mod 5
(5)* 4
20

Resultado: 20

 Problema 4: (d<65) && (3==d)

Procedimiento:
(5 < 65) and (3==5)
true and false
false

Resultado: fals
 Problema 5: a<=b || (3>a)

Procedimiento:
2<=3 or (3>2)
true or true
true

Resultado: true

 Problema 6: (c<=7+d) || (7>c)

Procedimiento:
(4<=7+5) or (7>4)
(4<=12) or (true)
true or true
true

Resultado: true

 Problema 7: (a>=d) && (2-14==c+1)

Procedimiento:
(2>=5) and (2-14==4+1)
(false) and (-12==5)
false and false
false

Resultado: false
 Problema 8: a % d % c

Procedimiento:
2 mod 5 mod 4
2 mod 4
2

Resultado: 2

 Problema 9: 3+5*d % 10

Procedimiento:
3 + 5 * 5 mod 10
3 + 25 mod 10
3+5
8

Resultado: 8

 Problema 10: a/b % 2

Procedimiento:
2 / 3 mod 2
2/1
2

Resultado: 2
 Problema 11: -a*7

Procedimiento:
-2 * 7
-14

Resultado: -4

 Problema 12: (a>b) && (b<c) || (d>5)

Procedimiento:
(2 > 3) and (3 < 4) or (5 > 5)
false and true or false
false or false
false

Resultado: false

 Problema 13: ((a>b) || (a<c)) && ((a==c) || (a>=b))

Procedimiento:
((2 > 3) or (2 < 4)) and ((2==4) or (2 >= 3))
((false) or (true)) and ((false) or (false))
(false or true) and (false or false)
true and false
false

Resultado: false
 Problema 14: ((a>=b) && (c<d))

Procedimiento:
((2 >= 3) and (4 < 5))
(false and true)
false

Resultado: false

 Problema 15: !(a<=c) || (c>d)

Procedimiento:
no (2 <= 4) or (4 > 5)
no (true) or false
false or false
false

Resultado: false

También podría gustarte