Trabajo Práctico Camila Rodríguez 1º B
Jan 24, 2016
Trabajo PrácticoCamila Rodríguez
1º B
DIAGRAMA:
PANTALLA:ingrese un numero
Respuesta si
CALCULAR
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
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
PANTALLA:Ingrese un Número
ComprobarRespuesta El numero es nulo
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
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
PANTALLA:Ingrese 4 Números
Respuesta
Comprobar
ingrese numeros positivos solamente
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
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
PANTALLA:Igrese 2 números
Respuesta:Prmero Negativo y Segundo Positivo
Calcular
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
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
PANTALLAIngrese 2 numeros enteros
Respuesta El segundo es mayor que el primero
Calcular
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
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
PANTALLAIngrese 4 numeros
Respuesta 1000
calcular
Label4
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
DIAGRAMA6. Ingresar un número cualquiera e informar si es par o impar
C
N1
RESULTADO = N1 MOD2
RESULTADO = 1IMPAR
PAR
SI
NO
F
PANTALLAIngrese un numero
Respuesta Par
Calcular
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