0% found this document useful (0 votes)
19 views

Form1: Codificacion Option Explicit On Public Class

This document contains code for a Visual Basic .NET Windows Forms application that performs calculations related to tax calculations. It defines variables and constants, performs calculations assigning values to variables like v1, v2, etc. based on input values, and displays the results in text boxes on the form. It also includes a method to open a secondary "vista" form to display the variable values.

Uploaded by

Christian Avila
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Form1: Codificacion Option Explicit On Public Class

This document contains code for a Visual Basic .NET Windows Forms application that performs calculations related to tax calculations. It defines variables and constants, performs calculations assigning values to variables like v1, v2, etc. based on input values, and displays the results in text boxes on the form. It also includes a method to open a secondary "vista" form to display the variable values.

Uploaded by

Christian Avila
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

codificacion

Option Explicit On
Public Class Form1

Private Sub Calcular_Click(ByVal sender As Object, e As EventArgs) Handles Calcular.Click


Dim pzc, fp, ttc, cf, oh, od, id, ida, pzca, dlp, dlr, rlp, ralp, rlr, ralr, fs, vlp, vlr, v1, v2, v3,
v4, v5 As Single
Dim sxt, sxlp, sxlr As Integer
Dim valp, valr, vta, vd As Single
Dim df, pfra, pf As Single
pzc = Val(txt_pzc.Text)
fp = Val(txt_fp.Text)
ttc = Val(txt_ttc.Text)
cf = Val(txt_cf.Text)
oh = Val(txt_oh.Text)
od = Val(txt_od.Text)
id = Val(txt_id.Text)
ida = Val(txt_ida.Text)
pzca = Val(txt_pzca.Text)
dlp = Val(txt_dlp.Text)
dlr = Val(Txt_dlr.Text)
rlp = Val(Txt_rlp.Text)
ralp = Val(Txt_ralp.Text)
rlr = Val(Txt_rlr.Text)
ralr = Val(Txt_ralr.Text)
fs = Val(Txt_fs.Text)
sxt = Val(Txt_sxt.Text)
vlp = Val(Txt_vlp.Text)
vlr = Val(Txt_vlr.Text)
df = Val(txt_df.Text)
v1 = (id ^ 2 / 1029.4) * (pzc - cf)
v2 = (oh ^ 2 / 1029.4) * (fp - pzc) * fs
v3 = (((oh ^ 2) - (od ^ 2)) / 1029.4) * (pzc - ttc) * fs
v4 = (((oh ^ 2) - (od ^ 2)) / 1029.4) * (ttc - pzca) * fs
v5 = (((ida ^ 2) - (od ^ 2)) / 1029.4) * pzca
vlp = v1 + v2 + v3
vlr = v4 + v5
sxlp = vlp / rlp
sxlr = vlr / rlr
sxt = sxlp + sxlr
sxt = Math.Round(sxt, 0)
valp = sxlp * ralp
valr = sxlr * ralr
vta = valp + valr
pfra = 0.052 * df * pzc
pf = (0.052 * ttc * dlr) + (0.052 * (pzc - ttc) * dlp)
vd = ((id ^ 2) / 1029.4) * cf
txt_vlp.Text = vlp
Txt_vlr.Text = vlr
Txt_sxt.Text = sxt
txt_vra.Text = vta
txt_pfra.Text = pfra

txt_pf.Text = pf
TextBox1.Text = vd
End Sub

Private Sub Salir_Click(sender As Object, e As EventArgs) Handles Salir.Click


Close()
End Sub
Private Sub btb_vista_Click(sender As Object, e As EventArgs) Handles btb_vista.Click
Dim frm As New vista()
Dim pzc, fp, ttc, cf, oh, od, id, ida, pzca, dlp, dlr, rlp, ralp, rlr, ralr, fs, vlp, vlr, v1, v2, v3,
v4, v5 As Single
Dim sxt, sxlp, sxlr As Integer
Dim valp, valr, vta, vd As Single
Dim df, pfra, pf As Single
pzc = Val(txt_pzc.Text)
fp = Val(txt_fp.Text)
ttc = Val(txt_ttc.Text)
cf = Val(txt_cf.Text)
oh = Val(txt_oh.Text)
od = Val(txt_od.Text)
id = Val(txt_id.Text)
ida = Val(txt_ida.Text)
pzca = Val(txt_pzca.Text)
dlp = Val(txt_dlp.Text)
dlr = Val(Txt_dlr.Text)
rlp = Val(Txt_rlp.Text)
ralp = Val(Txt_ralp.Text)
rlr = Val(Txt_rlr.Text)
ralr = Val(Txt_ralr.Text)
fs = Val(Txt_fs.Text)
sxt = Val(Txt_sxt.Text)
vlp = Val(txt_vlp.Text)
vlr = Val(Txt_vlr.Text)
df = Val(txt_df.Text)
v1 = (id ^ 2 / 1029.4) * (pzc - cf)
v2 = (oh ^ 2 / 1029.4) * (fp - pzc) * fs
v3 = (((oh ^ 2) - (od ^ 2)) / 1029.4) * (pzc - ttc) * fs
v4 = (((oh ^ 2) - (od ^ 2)) / 1029.4) * (ttc - pzca) * fs
v5 = (((ida ^ 2) - (od ^ 2)) / 1029.4) * pzca
vlp = v1 + v2 + v3
vlr = v4 + v5
sxlp = vlp / rlp
sxlr = vlr / rlr
sxt = sxlp + sxlr
sxt = Math.Round(sxt, 0)
valp = sxlp * ralp
valr = sxlr * ralr
vta = valp + valr
pfra = 0.052 * df * pzc
pf = (0.052 * ttc * dlr) + (0.052 * (pzc - ttc) * dlp)
vd = ((id ^ 2) / 1029.4) * cf
frm.Label15.Text = CStr(v5) + frm.Label15.Text

frm.Label2.Text = CStr(ida) + frm.Label2.Text


frm.Label5.Text = CStr(pzca) + frm.Label5.Text
frm.Label4.Text = CStr(dlp) + frm.Label4.Text
frm.Label16.Text = CStr(id) + frm.Label16.Text
frm.Label8.Text = CStr(ttc) + frm.Label8.Text
frm.Label7.Text = CStr(v3) + frm.Label7.Text
frm.Label10.Text = CStr(df) + frm.Label10.Text
frm.Label9.Text = CStr(pzc) + frm.Label9.Text
frm.Label1.Text = CStr(fp) + frm.Label1.Text
frm.Label12.Text = CStr(v2) + frm.Label12.Text
frm.Label11.Text = CStr(v1) + frm.Label11.Text
frm.Label3.Text = CStr(vd) + frm.Label3.Text
frm.Label17.Text = CStr(v3) + frm.Label17.Text
frm.Label14.Text = CStr(dlp) + frm.Label14.Text
frm.Label13.Text = CStr(v4) + frm.Label13.Text
frm.Label6.Text = CStr(dlr) + frm.Label6.Text
frm.Show()
End Sub
End Class

You might also like