Practica 2
Practica 2
Practica 2
For i = 3 To serie
num = i
num = num * num
MsgBox "Serie " & num
Next
End Sub
End Sub
Public Sub numenterol()
Dim n As Integer
Dim b1, b2, h, area, i As Integer
MsgBox "EJERCICIO 3"
If n <= 0 Then
MsgBox "El número tiene que ser mayor a 0"
Else
For i = 1 To 10
b1 = Int((n * Rnd) + 1)
b2 = Int((n * Rnd) + 1)
h = Int((n * Rnd) + 1)
area = h + ((b1 * b2) / 2)
MsgBox "Area del Trapecio " & i & ": " & area & " m^2"
Next
End If
End Sub
If n <= 0 Then
MsgBox "El número tiene que ser mayor a 1"
Else
For i = 1 To 10
b1 = (Int((n * Rnd) + 1)) * 2
b2 = (Int((n * Rnd) + 1)) * 2
h = (Int((n * Rnd) + 1)) * 2
area = h + ((b1 * b2) / 2)
MsgBox "Area del Trapecio " & i & ": " & area & " m^2"
Next
End If
End Sub
ReDim cuadrados(numCuadrados)
For i = 0 To numCuadrados
Lado = InputBox("Ingrese el lado del cuadrado")
cuadrados(i) = Lado
For j = 0 To (i - 1)
If i = 0 Then
Else
Do While cuadrados(j) = Lado
Lado = InputBox("Este cuadrado ya está creado, Ingrese
otro")
Loop
End If
Next
area = Lado * Lado
MsgBox "El cuadrado " & i & ": " & area & " de area"
Next
End Sub
Public Sub cuadradosll()
Dim L As Double, a As Double
MsgBox "EJERCICIO 5"
L = InputBox("ingrese el lado del cuadrado (cm): ", "creacion de cuadrado")
a = L * L
MsgBox " se genero un cuadrado de " & a & " cm2", vbInformation, "creacion de
cuadrado"
End Sub
Public Sub parabola()
Dim x, y As Double
End Sub
Public Sub cordon()
Dim Ancho, Longitud, Perimetro, area As Integer
MsgBox "EJERCICIO 7"
Ancho = 40
Longitud = 20
Longitud = Longitud + 1
Ancho = Ancho - 1
Loop
End Sub
MsgBox "El volumen es: " & volumen & "Pi cm^3"
End If
End Sub
Dim x, h, a As Long
If x > 0 Then
h = (16000 / (x * x)) * 2
a = (4 * x * 16000 / (x * x)) + (x * x)
Else
MsgBox "La base tiene que ser un número mayor a 0"
End If
MsgBox "El area de la Caja con respecto a la longitud " & x & " es: " & a & "
cm^2"
End Sub