22
Trabajo Práctico Camila Rodríguez 1º B

Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

Embed Size (px)

Citation preview

Page 1: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

Trabajo PrácticoCamila Rodríguez

1º B

Page 2: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA:

Page 3: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLA:ingrese un numero

Respuesta si

CALCULAR

Page 4: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGRAMACION

Private Sub CommandButton1_Click()Dim NumeroA As Integer

Label1 = "ingrese un numero"NumeroA = Val(TextBox1)

If NumeroA > 5 Then Label3 = "si"

Else Label3 = "no"

End IfEnd Sub

Page 5: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA:1. Ingresar un número cualquiera e informar si es positivo, negativo o nulo.

C

NUMERO

NUMERO = 0 NULO

VERDADERO

NUMERO > 0

POSITIVO

VERDADERO

NEGATIVO

FALSO

F

Page 6: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLA:Ingrese un Número

ComprobarRespuesta El numero es nulo

Page 7: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGRAMACION:Private Sub CommandButton1_Click()

Dim Numero1 As IntegerNumero1 = Val(TextBox1)

If Numero1 = 0 Then Label3 = ("El numero es nulo")

Else If Numero1 > 0 Then

Label3 = ("El numero es Positivo") Else

Label3 = ("El numero es negativo") End If

End IfEnd Sub

Page 8: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA:2. Ingresar 4 número cualesquiera. Informar el total si todos son positivos. Si no , informar "ingrese números positivos solamente".

C

NUMERO 1

NUMERO 2

NUMERO 3

NUMERO 4

NUMERO1,2,3,4 > 0

SUMA= N1 + N2 + N3 + N4

SI

POSITIVOS SOLAMENTE

NO

F

Page 9: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLA:Ingrese 4 Números

Respuesta

Comprobar

ingrese numeros positivos solamente

Page 10: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGRAMACION:Private Sub

CommandButton1_Click()Dim n1 As IntegerDim n2 As IntegerDim n3 As IntegerDim n4 As Integern1 = Val(TextBox1)n2 = Val(TextBox2)n3 = Val(TextBox3)n4 = Val(TextBox4)

If n1 > 0 And n2 > 0 And n3 > 0 And n4 > 0 Then

Label3 = n1 + n2 + n3 + n4 Else

Label3 = ("ingrese numeros positivos solamente")

End IfEnd Sub

Page 11: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA3. Ingresar dos números cualesquiera. Informar "ambos positivos", "ambos negativos", "primero positivo y segundo no" o "segundo positivo y primero no"

C

NUMERO 1

NUMERO 2

N1 and N2 > 0 AMBOS POSITIVOS

N1 AND N2 < 0

AMBOS NEGATIVOS

N1 >0 AND N2

<0

PRIMERO POSITIVO Y SEGUNDO NEGATIVO

N1 < 0 AND N2

> 0

PRIMERO NEGATIVO Y SEGUNDO POSITIVO

F

Page 12: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLA:Igrese 2 números

Respuesta:Prmero Negativo y Segundo Positivo

Calcular

Page 13: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGRAMACIONPrivate Sub CommandButton1_Click()

Dim n1 As IntegerDim n2 As Integern1 = Val(TextBox1)n2 = Val(TextBox2)

If n1 > 0 And n2 > 0 Then Label3 = ("Ambos Positivos")

End IfIf n1 < 0 And n2 < 0 Then

Label3 = ("Ambos Negativos") End If

If n1 > 0 And n2 < 0 Then Label3 = ("Primero Positivo y Segundo Negativo")

End IfIf n1 < 0 And n2 > 0 Then

Label3 = ("Prmero Negativo y Segundo Positivo")End If

End Sub

Page 14: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA4. 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

N 1

N 2

N1 > N2

EL PRIMEROES MAYOR QUE EL SEGUNDO

N1 < N2

EL SEGUNDO ES MAYOR QUE EL PRIMERO

N1 = N2 SON IGUALES

F

Page 15: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLAIngrese 2 numeros enteros

Respuesta El segundo es mayor que el primero

Calcular

Page 16: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGAMACIONPrivate Sub CommandButton1_Click()

Dim n1 As IntegerDim n2 As Integern1 = Val(TextBox1)n2 = Val(TextBox2)

If n1 > n2 Then Label3 = ("El primero es mayor que el segundo")

End IfIf ni < n2 Then

Label3 = ("El segundo es mayor que el primero") End If

If n1 = n2 Then Label3 = (" Son iguales")

End IfEnd Sub

Page 17: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA5. Ingresar cuatro números cualesquiera, si su suma es mayor a 15 elevarlo al cuadrado, si no, elevarlo al cubo.

C

N1

N2

N3

N4

N1 + N2 + N3 + N4 =

R >15R*R

N1 + N2 + N3 + N4 =

R <15R*R*R

F

Page 18: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLAIngrese 4 numeros

Respuesta 1000

calcular

Label4

Page 19: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGRAMACIONPrivate Sub CommandButton1_Click()

Dim n1 As IntegerDim n2 As IntegerDim n3 As IntegerDim n4 As IntegerDim R As Integer

n1 = Val(TextBox1)n2 = Val(TextBox2)n3 = Val(TextBox3)n4 = Val(TextBox4)

R = n1 + n2 + n3 + n4

If R > 15 Then Label3 = R * R

End IfIf R < 15 Then

Label3 = R * R * REnd If

End Sub

Page 20: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

DIAGRAMA6. Ingresar un número cualquiera e informar si es par o impar

C

N1

RESULTADO = N1 MOD2

RESULTADO = 1IMPAR

PAR

SI

NO

F

Page 21: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PANTALLAIngrese un numero

Respuesta Par

Calcular

Page 22: Camila Rodríguez 1º B. DIAGRAMA: PANTALLA: PROGRAMACION Private Sub CommandButton1_Click() Dim NumeroA As Integer Label1 = "ingrese un numero" NumeroA

PROGRAMACION

Private Sub CommandButton1_Click()Dim n1 As Integer

Dim Resultado As Integern1 = Val(TextBox1)

If n1 < 0 ThenLabel3 = ("Por favor ingrese números mayores a 0")

Else Resultado = n1 Mod 2

If Resultado = 1 Then Label3 = ("Impar")

Else Label3 = ("Par")

End IfEnd If

End Sub