You are on page 1of 8

ESCUELA DE CIENCIAS BSICAS, TECNOLOGA E INGENIERA

201416A_363 VISUAL BASIC BASICO

Presentado por:
YESITH ALFONSO CARDENAS SEVERICHE

Componente practico
GRUPO 201416_39

Tutor:
HERNANDO ARBEY ROBLES

UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA UNAD


201416A_363 VISUAL BASIC BASICO
OCTUBRE 2017
INTRODUCCIN.

In the present work we will learn about the programming structures such as selection
and repetition (Case and Structures While and While While) the knowledge and the
necessary foundation in the management of these.
4.Disee un programa que permita validar una clave de acceso y un usuario, informando que
se ha equivocado y que tiene solo 3 intentos al 4 intento debe ocultar los espacios de clave o
usuario. Se debe manejar 1 minuto de tiempo para digitar la clave si pasado el tiempo no la
digita o no ha realizado la entrada se debe ocultar o deshabilitar.
Public Class LoginForm1
Dim contador As Integer
' autenticacin personalizada usando el nombre de usuario y la contrasea proporcionada

Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


OK.Click

Dim usuario As String = "admin"


Dim contrasea As String = "admin"

If (txtuser.Text = usuario And txtpass.Text = contrasea) Then 'condicion

Form1.Show() 'si si abra el formulario principal


Me.Hide() ' y cierre el formulario abierto

ElseIf (contador > 2) Then


MsgBox("ha superado el limite de intentos")

txtuser.Enabled = False
txtpass.Enabled = False
Else
MsgBox("Usuario o contrasea son incorrectos, Tiene solo 3 intentos, LLeva " & contador
+ 1 & " intento") 'sino es correcto el usuario usado muestre el mensaje usuario incorrecto
txtuser.Text = ""
txtpass.Text = ""
contador += 1
Label1.Text = contador
End If
End Sub

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Cancel.Click
Me.Close()
End Sub
Private Sub PasswordTextBox_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtpass.TextChanged

End Sub

Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


MyBase.Load

End Sub
End Class

1. Calcular la masa corporal de una persona (IMC) y los clasifique segn el cuadro de ndice
masa corporal y clasificacin. Es importante que recuerde introducir su altura en centmetros
en lugar de en metros en la casilla de altura. De esta forma, si mide 1.70 metros, deber
escribir 170 en el cuadro de altura.

Se debe validar que solo ingresen nmeros, que no acepte valores mayores a 230 cms y peso
mayor a 200 kilos, que no acepte 0 en ninguna de las casillas.

Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Dim p As Double
Dim a As Double
Dim imc As Double

p = TextBox1.Text
a = TextBox2.Text
imc = Val(TextBox1.Text) / (Val(TextBox2.Text) * Val(TextBox2.Text))

TextBox3.Text = imc

If imc < 16 Then


TextBox4.Text = "Tiene Infrapeso: Delgadez Severa"
ElseIf (imc <= 16.99) Then
TextBox4.Text = "Tiene Infrapeso: Delgadez: Moderada"
ElseIf (imc <= 18.49) Then
TextBox4.Text = "Tiene Infrapeso: Delgadez: Aceptable"
ElseIf (imc <= 24.99) Then
TextBox4.Text = "Tiene un Peso Normal"
ElseIf (imc <= 29.99) Then
TextBox4.Text = "Tiene Sobrepeso"
ElseIf (imc <= 34.99) Then
TextBox4.Text = "Es Obeso: Tipo I"
ElseIf (imc <= 40) Then
TextBox4.Text = "Es Obeso: Tipo II"
Else
TextBox4.Text = "Es Obeso: Tipo III"
End If

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles


MyBase.Load

End Sub

End Class

10. Disee un programa que me permita guardar en un arreglo 10 edades, me muestre la


mayor, la menor, el promedio de edades.

Se debe validar que solo ingresen nmeros, que no acepte valores negativos, que no acepte 0
en ninguna de las casillas, no acepte edad mayor a 130 aos.
Conclusiones

From the present work we can conclude that we must know in a clear and precise way the
management of the different programming structures such as those of selection and repetition
in order to optimize the programs that we develop.

In the same way we can conclude that the knowledge of a programming language gives us
infinite possibilities to develop programs that offer solutions to the problems that we can find
in our environment.
Referencias bibliogrficas

Rubiano. J. (2016). Material de apoyo unidad 2. Recuperado de


http://hdl.handle.net/10596/9361

Tutorial Visual Basic .NET - Parte 3. (2013). Arreglos.


[Archivo de video]. Recuperado
de.https://www.youtube.com/watch?v=broPkjHSh0M

Fernndez, C. (2009). Visual Basic: bsico. Madrid, ES: RA-MA Editorial. Captulo 4
entrada y salida estndar. Recuperado de
http://bibliotecavirtual.unad.edu.co:2077/lib/unadsp/reader.action?ppg=52&docID=1
1046605&tm=1480460037723

You might also like