informatica

Páginas: 2 (380 palabras) Publicado: 21 de marzo de 2013
COLEGIO EXPERIMENTAL SIMÓN BOLÍVAR
NOMBRE: KAREN GUAYASAMÍN
CURSO: 6TO “C” INFORMÁTICA
FECHA: 29-09-2011
Elabore un programa que permita crear un vector de 6 posiciones y ordenarlo de formaascendente los números ingresados por el usuario.

Dim num As Integer
Dim a(5) As Double
Dim i As Integer
Dim j As Integer
Dim e As Integer
Dim mayor As Integer
Private Sub cmdingresar_Click()For x = 0 To 4
num = InputBox("Ingrese 5 numeros", "NUMEROS")
txtnum(x) = num
Next
End Sub
Private Sub cmdordenar_Click()
On Error Resume Next
e = 1
mayor = 1
Do
a(e) =InputBox("Numero " & e, "Ingrese numero")
If Err.Number 0 Then
MsgBox "Debe ingresar un numero"
Err.Clear
End If
e = e + 1
Loop Until e > 5
For i = 1 To 7
For j = 1 To 6
If a(j) > a(j + 1) Then
s = a(j)a(j) = a(j + 1)
a(j + 1) = s
End If
Next j
Next i
f = ""
For i = 1 To 5
f = f & a(i) & " "
Next i
MsgBox "Los numeros ordenados son " & f
End Sub
Private Sub cmdnuevo_Click()
txtnum = ""End Sub
Private Sub cmdsalir_Click()
End
End Sub
Elaborar un programa que tenga el nombre pre asignado al momento de iniciar.


Dim vec(4) As String
Dim i As Integer
Private Sub Form_Load()vec(0) = "C"
vec(1) = "A"
vec(2) = "B"
vec(3) = "R"
vec(4) = "A"
For i = 0 To 4
txt1(i) = vec(i)
Next i
End Sub
Private Sub cmdsalir_Click()
End
End Sub



Crear un vector de 6posiciones y realizar una simulación de el juego del ahorcado en donde el usuario debe ingresar una letra para adivinar la palabra pre-asignada el finalizar marcar los errores cometidos y de no existirenvie un mensaje de felicitación.

Dim i As Integer
Dim er As Integer
Dim v2(3) As String
Dim v(3) As String
Private Sub cmdingresar_Click()
For i = 0 To 3
v2(i) = InputBox("Ingrese letra","letra")
If v(i) = v2(i) Then
txtletra(i) = v(i)
Else
txtletra(i) = "x"
er = er + 1
Image1(er).Visible = True
End If
Next i
If er = 0 Then
MsgBox...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Informatica
  • Informatica
  • Informatica
  • Informatica
  • Informatica
  • Informática
  • Informatica
  • Informatica

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS