0% found this document useful (0 votes)
20 views3 pages

Examen: Public Class Dim As Integer

This document contains code for a payroll calculator application. The code defines variables for an employee's job category, normal hours, overtime hours, deductions, and total pay. When the accept button is clicked, it calculates the employee's total earnings and deductions and displays the results. It also contains code to preset default hourly rates based on job category and clear all fields when a new calculation is started.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views3 pages

Examen: Public Class Dim As Integer

This document contains code for a payroll calculator application. The code defines variables for an employee's job category, normal hours, overtime hours, deductions, and total pay. When the accept button is clicked, it calculates the employee's total earnings and deductions and displays the results. It also contains code to preset default hourly rates based on job category and clear all fields when a new calculation is started.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Examen

CODIGOS:
Public Class Form1
Dim maestro, oficial, peon, descuento, categoria, normales, essalud, snp,
impuesto, total, extras As Integer

Private Sub baceptar_Actived(sender As Object, e As EventArgs) Handles


baceptar.Click
maestro = Val(tnormales.Text)
maestro = Val(textras.Text)
oficial = Val(tnormales.Text)
oficial = Val(textras.Text)
peon = Val(tnormales.Text)
peon = Val(textras.Text)
'variable para el ingreso en horas
tnor.Text = Val(tnormales.Text)
ttex.Text = Val(textras.Text)
ttotalingresos.Text = Val(tnor.Text) + Val(ttex.Text)

'Variable para el descuento de los ingresos


If total > 100 Then
essalud = 0.03 * Val(ttotalingresos.Text)
Else
essalud = 0.02 * Val(ttotalingresos.Text)
End If
snp = 0.05 * Val(ttotalingresos.Text)
impuesto = 0.07 * Val(ttotalingresos.Text)

descuento = essalud + snp + impuesto


ttotaldescuento.Text = descuento
tessalud.Text = essalud
tsnp.Text = snp
tsolidaridad.Text = impuesto

tneto.Text = Val(ttotaldescuento.Text) - Val(ttotalingresos.Text)

End Sub

Private Sub GroupBox1_Enter(sender As Object, e As EventArgs) Handles


GroupBox1.Enter
Me.cbcategoria.Text = Val(tnormales.Text)
Me.cbcategoria.Text = Val(textras.Text)
'variables para la hora x cada item
maestro = 4
tnormales.Text = maestro

maestro = 5
textras.Text = maestro

oficial = 3.5
tnormales.Text = oficial

oficial = 4
textras.Text = oficial

peon = 3
tnormales.Text = peon

peon = 3.5
textras.Text = peon

End Sub

Private Sub bnuevo_Click(sender As Object, e As EventArgs) Handles


bnuevo.Click
Me.cbcategoria.Text = ""
Me.tnormales.Text = ""
Me.textras.Text = ""
Me.tnor.Text = ""
Me.ttex.Text = ""
Me.tessalud.Text = ""
Me.tsnp.Text = ""
Me.tsolidaridad.Text = ""
Me.ttotalingresos.Text = ""
Me.ttotaldescuento.Text = ""
Me.tneto.Text = ""
Me.tneto.Focus()
End Sub

Private Sub bcancelar_Click(sender As Object, e As EventArgs) Handles


bcancelar.Click
End
End Sub
End Class

You might also like