desp. b mejora

advertisement
Interfaz
pSeudocódigos
Public Class Form1
Dim Acumulador As Single = 0
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Button1.Text = "Calcular"
Button2.Text = "Limpiar"
Button3.Text = "Salir"
Button4.Text = "Calcular"
Button5.Text = "Limpiar"
Button6.Text = "Salir"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
lblDespl1.Text = (3.1416 * (TextBox3.Text) ^ 2 * TextBox2.Text * 3 * (TextBox1.Text / 100)) / 4
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
lblDespl1.Text = ""
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
End
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
lblDespl2.Text = (3.1416 * (2 * (TextBox6.Text) ^ 2 - (TextBox7.Text) ^ 2) * TextBox5.Text * 3 * (TextBox4.Text /
100)) / 4
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
lblDespl2.Text = ""
End Sub
Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
End
End Sub
Private Sub BtnAcumular_Click(sender As Object, e As EventArgs) Handles BtnAcumular.Click
Const BARRILES_GAL As Single = 42
Const BARRILES_LITROS As Single = 159
Acumulador = Acumulador + Val(lblDespl1.Text)
Acumulador = Acumulador + Val(lblDespl2.Text)
lblBarriles.Text = Math.Round(Acumulador, 2) & "Bbl"
lblGalones.Text = Math.Round(Acumulador * BARRILES_GAL, 2) & "Gal"
lblLitros.Text = Math.Round(Acumulador * BARRILES_LITROS, 2) & "lt"
End Sub
Private Sub BtnLimpiar_Click(sender As Object, e As EventArgs) Handles BtnLimpiar.Click
TextBox1.Clear()
lblBarriles.ResetText()
lblGalones.ResetText()
lblLitros.ResetText()
End Sub
Private Sub BtnReiniciar_Click(sender As Object, e As EventArgs) Handles BtnReiniciar.Click
TextBox1.Clear()
lblBarriles.ResetText()
lblGalones.ResetText()
lblLitros.ResetText()
Acumulador = 0
End Sub
End Class
Descargar