TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.
-
Upload
rafaela-torrico -
Category
Documents
-
view
3 -
download
2
Transcript of TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.
![Page 1: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/1.jpg)
TRABAJO PRÁCTICO 2Florencia Glasbauer y Luciana Pierangeli 1ºB
![Page 2: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/2.jpg)
Ejercicio 0
C
F
“Si”
“No”
NumeroA>5verdadero
NumeroA (TextBox)
falso
SalidaLabel
![Page 3: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/3.jpg)
Pantalla 0
Ingrese un número
El número es menor o igual que 5
Comprobar
![Page 4: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/4.jpg)
Private Sub CommandButton1_Click() Dim n As Integer n = Val(TextBox1) If n > 5 Then Label2 = ("El número es mayor que 5") Else Label2 = ("El número es menor o igual que 5") End If End Sub
Programación 0
![Page 5: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/5.jpg)
Ejercicio 1
Ingresar un número cualquiera e informar si es positivo, negativo o nulo. C
F
A=0 Nulo
Negativo
A
A>0 Positivo
verdadero
verdadero
falso
![Page 6: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/6.jpg)
Pantalla 1
Ingrese un número
El numero es negativo
Comprobar
![Page 7: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/7.jpg)
Private Sub CommandButton1_Click() Dim n1 As Integer n1 = Val(TextBox1) If n1 = 0 Then Label2 = ("El numero es nulo") Else If n1 > 0 Then Label2 = ("El numero es positivo") Else Label2 = ("El numero es negativo") End If End If End Sub
Programación 1
![Page 8: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/8.jpg)
Ejercicio 2
Ingresar 4 número cualesquiera. Informar el total si todos son positivos. Si no , informar "ingrese números positivos solamente".
C
F
A>0And B>0And C>0And D>0
Positivos solament
e
A+B+C+D
A
B
C
D
SI
NO
![Page 9: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/9.jpg)
Pantalla 2
Ingrese números
Todos los numeros deben ser positivos
Comprobar
![Page 10: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/10.jpg)
Private Sub CommandButton1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a = Val(TextBox1) b = Val(TextBox2) c = Val(TextBox3) d = Val(TextBox4) If a > 0 And b > 0 And c > 0 And d > 0 Then Label2 = a + b + c + d Else Label2 = ("Todos los numeros deben ser positivos ") End If End Sub
Programación 2
![Page 11: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/11.jpg)
Ejercicio 3
Ingresar dos números cualesquiera. Informar "ambos positivos", "ambos negativos", "primero positivo y segundo no" o "segundo positivo y primero no"
C
F
AA
A>0 and B>O
Ambos positivo
s
Primero positivo,
segundo no
A
B
A>0 and B<O
A<0 and B<O
A<0 and B>O
Ambos negativ
os
Primero negativo, segundo
no
![Page 12: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/12.jpg)
Pantalla 3
Ingrese dos números cualesquiera
Ambos positivos
Comprobar
![Page 13: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/13.jpg)
Private Sub CommandButton1_Click()
Dim n1 As Integer
Dim n2 As Integer
n1 = Val(TextBox1)
n2 = Val(TextBox2)
If n1 > 0 And n2 > 0 Then
Label2 = ("Ambos positivos")
Else
If n1 > 0 And n2 < 0 Then
Label2 = ("Primero positivo y segundo no")
Else
If n1 < 0 And n2 > 0 Then
Label2 = ("Primero negativo y segundo no")
Else
Label2 = ("AMBOS NEGATIVOS")
End If
End If
End If
End Sub
Programación 3
![Page 14: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/14.jpg)
Ejercicio 4
Ingresar dos números enteros cualesquiera. Informar "el primero es mayor que el segundo", "el segundo es mayor que el primero" o "son iguales" según corresponda.
C
F
A
B
A>B
A<B
A=B
el primero es mayor
que el segundo
Son iguales
El segundo es mayor que el
primero
![Page 15: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/15.jpg)
Pantalla 4
Ingrese dos números enteros
El segundo es mayor que el primero
Comprobar
![Page 16: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/16.jpg)
Private Sub CommandButton1_Click() Dim a As Integer Dim b As Integer a = Val(TextBox1) b = Val(TextBox2) If a > b Then Label2 = ("El primero es mayor que el segundo") Else Label2 = ("El segundo es mayor que el primero") If a = b Then Label2 = ("son iguales") End If End If End Sub
Programación 4
![Page 17: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/17.jpg)
Ejercicio 5
Ingresar cuatro números cualesquiera, si su suma es mayor a 15 elevarlo al cuadrado, si no, elevarlo al cubo.
C
F
(A+B+C+D ) >15
(A+B+C+D)<15
Elevarlo al cuadrado
Elevarlo al cubo
A
B
C
D
![Page 18: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/18.jpg)
Pantalla 5
Ingresar cuatro números cualesquiera
256
Comprobar
![Page 19: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/19.jpg)
Private Sub CommandButton1_Click() Dim a As Integer Dim b As Integer Dim c As Integer Dim d As Integer a = Val(TextBox1) b = Val(TextBox2) c = Val(TextBox3) d = Val(TextBox4) If (a + b + c + d) > 15 Then Label2 = (a + b + c + d) * (a + b + c + d) Else Label2 = (a + b + c + d) * (a + b + c + d) * (a + b + c + d) End If End Sub
Programación 5
![Page 20: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/20.jpg)
Ejercicio 6
Ingresar un número cualquiera e informar si es par o impar
C
F
AA
termina en 0,2,4,6,8
IMPAR
A
PAR
no
si
![Page 21: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/21.jpg)
Pantalla 6
Ingrese un número cualquiera
El numero es impar
Comprobar
![Page 22: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/22.jpg)
Private Sub CommandButton1_Click() Dim p As Integer p = Val(TextBox1) If p / 2 = Int(p / 2) Then Label2 = ("El numero es par") Else Label2 = ("El numero es impar") End If End Sub
Programación 6
![Page 23: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/23.jpg)
Ejercicio 7
Ingresar dos números, sumarlos e informar si la suma da por resultado un número par o impar.
C
F
A+B = (“termina en o,2,4,6,8”) PAR
IMPAR
A
B
no
si
![Page 24: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/24.jpg)
Pantalla 7
Ingresar dos números
El número es par
Comprobar
![Page 25: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/25.jpg)
Private Sub CommandButton1_Click() Dim a As Integer Dim b As Integer a = Val(TextBox1) b = Val(TextBox2) If ((a + b) / 2) = (Int(a + b) / 2) Then Label2 = ("El número es par") Else Label2 = ("El número es impar") End If End Sub
Programación 7
![Page 26: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/26.jpg)
Ejercicio 8
Ingresar un número cualquiera e informar si es positivo y par, positivo impar, negativo par o negativo impar.
C
F
A
A
A>0 and termina en o,2,4,6,8
A>o and termina en 1,3,5,7,9
A<0 and termina en 0,2,4,6,8
A<0 and termina en 1,3,5,7,9
Negativo par
Negativo impar
Positivo impar
Positivo par
![Page 27: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/27.jpg)
Pantalla 8
Ingrese un número cualquiera
El numero es impar y positivo
Comprobar
![Page 28: TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.](https://reader035.fdocument.pub/reader035/viewer/2022081602/54dc944949795947518b4670/html5/thumbnails/28.jpg)
Private Sub CommandButton1_Click() Dim a As Integer a = Val(TextBox1) If a > 0 And (a / 2) = Int(a / 2) Then Label2 = ("El número es par y positivo") Else Label2 = ("El numero es impar y positivo") If a < 0 And (a / 2) = Int(a / 2) Then Label2 = ("El numero es par y negativo") Else Label2 = ("El numero es impar y negativo") End If End If End Sub
Programación 8