La descarga está en progreso. Por favor, espere

La descarga está en progreso. Por favor, espere

TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB.

Presentaciones similares


Presentación del tema: "TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB."— Transcripción de la presentación:

1 TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB

2 Ejercicio 0 C F “Si” “No” NumeroA>5 verdadero NumeroA (TextBox) falso Salida Label

3 Pantalla 0

4  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

5 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 falso

6 Pantalla 1

7  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

8 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>0 And B>0 And C>0 And D>0 Positivos solamente A+B+C+D A B C D SI NO

9 Pantalla 2

10  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

11 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 A A A>0 and B>O Ambos positivos Primero positivo, segundo no A B A>0 and B<O A<0 and B<O A O Ambos negativos Primero negativo, segundo no

12 Pantalla 3

13  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 Then  Label2 = ("Primero negativo y segundo no")  Else  Label2 = ("AMBOS NEGATIVOS")  End If  End Sub Programación 3

14 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

15 Pantalla 4

16  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 Sub Programación 4

17 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

18 Pantalla 5

19  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

20 Ejercicio 6  Ingresar un número cualquiera e informar si es par o impar C F A A termina en 0,2,4,6,8 IMPAR A PAR no si

21 Pantalla 6

22  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

23 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

24 Pantalla 7

25  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

26 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

27 Pantalla 8

28  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 Sub Programación 8


Descargar ppt "TRABAJO PRÁCTICO 2 Florencia Glasbauer y Luciana Pierangeli 1ºB."

Presentaciones similares


Anuncios Google