Programas de visual basic

Solo disponible en BuenasTareas
  • Páginas : 8 (1820 palabras )
  • Descarga(s) : 0
  • Publicado : 7 de diciembre de 2010
Leer documento completo
Vista previa del texto
Sub main()
Dim a, b, c As Integer
Dim TT As String
Console.WriteLine("ingrese lado A del triángulo:")
a = CInt(Console.ReadLine())
Console.WriteLine("ingrese lado B del triángulo:")
b = Console.ReadLine()
Console.WriteLine("ingrese lado C del triángulo:")
c = Console.ReadLine

If (a c And b c And b a)Then

TT = "ESCALENO"

ElseIf (b = c And a = b) Then
TT = "EQUILATERO"
Else
TT = "ISOSCELES"
End If
Console.WriteLine("El tipo de triángulo es:" & TT)
Console.ReadLine()

-------------------------------------------------
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button1.Click
Dim a, b, c, w, k As Integer
Dim TT As String

a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text

If (a c And b c And b a) Then

TT = "escaleno"

ElseIf (b = c And a = b) Then
TT = "EQUILATERO"
Else
TT = "ISOSCELES"
End IfTextBox4.Text = TT
w = a + b + c
TextBox5.Text = w

If (a > b) Then
If (b > c) Then
k = a
Else
k = a
End If
ElseIf (a > c) Then

k = b
Else
k = c

End If
TextBox6.Text = k
-------------------------------------------------
End Sub
SubMain()
Dim n As Integer
Dim nr As String

Console.Write("Ingrese un número entre 0 y 10:")
n = CInt(Console.ReadLine)

Select Case n
Case 1 : nr = "I"
Case 2 : nr = "II"
Case 3 : nr = "III"
Case 4 : nr = "IV"
Case 5 : nr = "V"
Case 6 : nr = "VI"
Case 7 : nr = "VII"Case 8 : nr = "VIII"
Case 9 : nr = "IX"
Case 10 : nr = "X"
Case Else : nr = "NO EXISTE"
End Select
Console.Write("Su eqivalente en romanos es:" & nr)
Console.ReadLine()
-------------------------------------------------
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button1.Click

Dim n As Integer
Dim nr As String

n = TextBox1.Text

Select Case n
Case 1 : nr = "I"
Case 2 : nr = "II"
Case 3 : nr = "III"
Case 4 : nr = "IV"
Case 5 : nr = "V"
Case 6 : nr = "VI"
Case 7 : nr = "VII"
Case 8 : nr = "VIII"Case 9 : nr = "IX"
Case 10 : nr = "X"
Case Else : nr = "NO EXISTE"
End Select
Label3.Text = nr
-------------------------------------------------
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim n As Double
Dim nr As Double
Dim k As Doublen = CDbl(TextBox1.Text)

Select Case n
Case 0 To 1000 : nr = n * 0.0
Case 1001 To 5000 : nr = n * 0.03
Case 5001 To 20000 : nr = n * 0.05
Case Is > 20000 : nr = n * 0.08

End Select

Label3.Text = nr
k = nr + n
Label5.Text = k

If CheckBox1.Checked = True Then
Label3.Visible =True
Label5.Visible = True
Else
Label3.Visible = False
Label5.Visible = False
End If
____________________________________________________________

__________
Rendimiento: Sub Main()

Dim A, B, C, PRO As Double
Console.WriteLine("ingrese nota 1:")
A = Console.ReadLine
Console.WriteLine("ingrese...
tracking img