Upload
renato-garcia
View
219
Download
0
Embed Size (px)
Citation preview
7/28/2019 Guia Progra
1/17
Elaborar una aplicacin para calcular el pago mensual de un trabajador, de acuerdo a losSiguientes criterios:
1. El salario base depende del tipo de empleado (ir disminuyendo de Q. 750 en Q. 750,Empezando por Gerente de Produccin con Q. 10000) Al seleccionar el puesto delEmpleado, se mostrar el Salario Base.
2. A cada empleado se le otorga una bonificacin de Q. 350.00 si es masculino y Q. 450.000 siEs femenino. Al seleccionar el gnero del empleado se mostrar la bonificacin que corresponde.
3. Se debe de calcular el pago por horas extras, en funcin del nmero de horas extrasTrabajadas. El pago de cada hora extra es de: Q. 35.00. Al escribir la cantidad de horasExtras que trabajo el empleado automticamente mostrar el pago de hora extra y elTotal Horas Extras.
4. Bonos: se debe mostrar el resultado al seleccionar cada uno de los diferentes bonosa. Familiar ser el 8% sobre su Salario Baseb. Metas ser el 10% sobre su Salario Basec. Incentivo ser el 15% sobre su Salario Base
5. Total Faltas: depender del nmero de faltas que cometi nuestro empleado. Por cadaFalta, se le descontar Q. 45.00. Se debe mostrar el resultado al momento de seleccionarLa cantidad de faltas que cometi.
6. Calcular Pago: dar el resultado de Pago Empleado, que ser la suma del Salario Base,
Bonificacin, Horas Extras y Bonos menos Total por Faltas
7. Borrar Datos: Limpia toda la interfaz.
8. Cerrar Programa: sale de la aplicacin, con mensaje.
7/28/2019 Guia Progra
2/17
La siguiente aplicacin deber llevar lo siguiente:
9 marcos
10 etiquetas
22 botones de opcin
3 casillas de verificacin
12 Cajas de texto
3 Botones de comando
Una vez indicado los controles, establezca las propiedades segn se indique:
Form1
Frame1
Frame2
Frame3
Nombre FrmEmpleados
BorderStyle 3-fixes Dialog
Caption Empleados
Nombre FraDatos
Caption Datos Personales
Nombre FraPuesto
Caption Puesto Empleado
Nombre FraSalario
Caption Salario Inicial
7/28/2019 Guia Progra
3/17
Frame4
Frame5
Frame6
Frame7
Frame8
Frame9
Nombre FraHorasextras
Caption Horas Extras
Nombre FraBonos
Caption Bonos
Nombre FraFaltas
Caption No.Faltas
Nombre FraDescuento
Caption Descuento Faltas
Nombre FraPago
Caption Pago Empleado
Nombre FraOperaciones
Caption Operaciones
7/28/2019 Guia Progra
4/17
Label1
Label2
Label3
Label4
Label5
Label6
Label7
Nombre LblNombre
AutoSize True
Caption Nombre Profesor:
Nombre LblFecha
AutoSize True
Caption Fecha Nacimiento:
Nombre LblGenero
AutoSize True
Caption Genero
Nombre LblSalario
AutoSize True
Caption Salario Base
Nombre LblBonificacion
AutoSize True
Caption Bonificacion
Nombre Lblhoraextra
AutoSize True
Caption cantidad Horas Extras
Nombre LblPagoextra
7/28/2019 Guia Progra
5/17
Label8
Label9
Label10
Opt1
Opt2
Opt3
AutoSize True
Caption Pago Horas Extras
Nombre LblTotalextra
AutoSize True
Caption Total Horas Extras
Nombre LblTotalfaltas
AutoSize True
Caption Total por Faltas
Nombre LblPagoEmpleado
AutoSize True
Caption Pago Empleado
Nombre OptMasculinoCaption Masculino
Nombre OptFemenino
Caption Femenino
Nombre OptGerentep
Caption Gerente de Produccion
7/28/2019 Guia Progra
6/17
Opt4
Opt5
Opt6
Opt7
Opt8
Opt9
Nombre OptGerentev
Caption Gerente de Ventas
Nombre OptGerentem
Caption Gerente de Mercadeo
Nombre OptGerenten
Caption Gerente Nocturno
Nombre OptAdministrador
Caption Administrador(a)
Nombre OptOperador
Caption Operador(a)
Nombre OptVendedor
Caption Vendedor(a)
7/28/2019 Guia Progra
7/17
Op10
Opt11
Opt12
Opt13
Opt14
Opt15
Opt16
Nombre OptDiseador
Caption Diseador(a)
Nombre OptSecretaria
Caption Secretaria
Nombre OptBodeguero
Caption Bodeguero
Nombre Opt1
Caption 1
Nombre Opt2
Caption 2
Nombre Opt3
Caption 3
7/28/2019 Guia Progra
8/17
Opt17
Opt18
Opt19
Opt20
Opt21
Opt22
Nombre Opt4
Caption 4
Nombre Opt5
Caption 5
Nombre Opt6
Caption 6
Nombre Opt7
Caption 7
Nombre Opt8Caption 8
Nombre Opt9
Caption 9
Nombre Opt10
Caption 10
7/28/2019 Guia Progra
9/17
Check1
Check2
Check3
Text1
Text2
Text3
Nombre ChkFamiliar
Caption Familiar
Nombre ChkMetas
Caption Metas
Nombre ChkIncentivo
Caption Incentivo
Nombre TxtNombre
Text
Alignment 2- center
Nombre TxtFecha
Text
Alignment 2-center
Nombre TxtSalario
Text
Alignment 2-center
7/28/2019 Guia Progra
10/17
Text4
Text5
Text6
Text7
Text8
Nombre TxtBonificacion
Text
Alignment 2-center
Nombre Txthoraextra
Text
Alignment 2-center
Nombre TxtPagoextra
Text
Alignment 2-center
Nombre TxtTotalextra
Text
Alignment 2-center
Nombre TxtFamiliar
Text
7/28/2019 Guia Progra
11/17
Text9
Text10
Text11
Text12
Command1
Alignment 2-center
Nombre TxtMetas
Text
Alignment 2-center
Nombre TxtIncentivo
Text
Alignment 2-center
Nombre TxtTotalfaltas
Text
Alignment 2-center
Nombre TxtPagoempleado
Text
Alignment 2-center
Nombre CmdCalcular
Caption &calcular pago
7/28/2019 Guia Progra
12/17
Command2
Command3
Luego de eso insertar el siguiente cdigo:
Dim SALARIO As Double
Dim BONIFICACION As Double
Dim HORAEXTRA As Double
Dim PAGOEXTRA As Double
Dim TOTALEXTRA As Double
Dim FAMILIAR As Double
Dim METAS As Double
Dim INCENTIVO As Double
Dim TOTALFALTAS As Double
Private Sub Chkfamiliar_Click()
If Chkfamiliar.Value Then
FAMILIAR = SALARIO * 0.08
Else
FAMILIAR = 0
End If
Txtfamiliar = Str(FAMILIAR)
End Sub
Private Sub Chkincentivo_Click()
If Chkincentivo.Value Then
INCENTIVO = SALARIO * 0.15
Else
Nombre CmdBorrar
Caption &Borrar Datos
Nombre CmdCerrar
Caption Cerrar &Programa
7/28/2019 Guia Progra
13/17
INCENTIVO = 0
End If
Txtincentivo = Str(INCENTIVO)
End Sub
Private Sub Chkmetas_Click()
If Chkmetas.Value ThenMETAS = SALARIO * 0.1
Else
METAS = 0
End If
Txtmetas = Str(METAS)
End Sub
Private Sub Cmdborrar_Click()
Optmasculino = False
Optfemenino = False
Optgerentep = False
Optgerentev = False
Optgerentem = FalseOptgerenten = False
Optadministrador = False
Optoperador = False
Optvendedor = False
Optdiseador = False
Optsecretaria = False
Optbodeguero = False
Opt1 = False
Opt2 = False
Opt3 = False
Opt4 = False
Opt5 = False
Opt6 = FalseOpt7 = False
Opt8 = False
Opt9 = False
Opt10 = False
Chkfamiliar.Value = False
Chkmetas.Value = False
Chkincentivo.Value = False
Txtnombre = ""
Txtfecha = ""
Txtsalario = ""
Txtbonificacion = ""
Txthoraextra = ""
Txtpagoextra = ""Txttotalextra = ""
Txtfamiliar = ""
Txtmetas = ""
Txtincentivo = ""
Txttotalfaltas = ""
Txtpagoempleado = ""
Txtnombre.SetFocus
End Sub
7/28/2019 Guia Progra
14/17
Private Sub Cmdcalcular_Click()
SALARIO = Val(Txtsalario)
BONIFICACION = Val(Txtbonificacion)
TOTALEXTRA = Val(Txttotalextra)
FAMILIAR = Val(Txtfamiliar)
METAS = Val(Txtmetas)INCENTIVO = Val(Txtincentivo)
TOTALFALTAS = Val(Txttotalfaltas)
PAGOEMPLEADO = (SALARIO + BONIFICACION + TOTALEXTRA + FAMILIAR + METAS + INCENTIVO) -
TOTALFALTAS
Txtpagoempleado = Str(PAGOEMPLEADO)
End Sub
Private Sub Cmdcerrar_Click()
If MsgBox("DESEA CERRAR EL PROGRAMA?", vbQuestion + vbYesNo, "MENSAJE") = vbYes Then
End
Else
Call Cmdborrar_Click
End IfEnd Sub
Private Sub Form_Load()
End Sub
Private Sub Opt1_Click()
If Opt1 Then
TOTALFALTAS = 45
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt10_Click()
If Opt10 Then
TOTALFALTAS = 450
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt2_Click()
If Opt2 Then
TOTALFALTAS = 90
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt3_Click()
If Opt3 Then
TOTALFALTAS = 135
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
7/28/2019 Guia Progra
15/17
Private Sub Opt4_Click()
If Opt4 Then
TOTALFALTAS = 180
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt5_Click()
If Opt5 Then
TOTALFALTAS = 225
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt6_Click()
If Opt6 Then
TOTALFALTAS = 270
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt7_Click()
If Opt7 Then
TOTALFALTAS = 315
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Opt8_Click()
If Opt8 Then
TOTALFALTAS = 360
End If
Txttotalfaltas = Str(TOTALFALTAS)End Sub
Private Sub Opt9_Click()
If Opt9 Then
TOTALFALTAS = 405
End If
Txttotalfaltas = Str(TOTALFALTAS)
End Sub
Private Sub Optadministrador_Click()
If Optadministrador Then
SALARIO = 7000
End IfTxtsalario = Str(SALARIO)
End Sub
Private Sub Optbodeguero_Click()
If Optbodeguero Then
SALARIO = 3250
End If
Txtsalario = Str(SALARIO)
7/28/2019 Guia Progra
16/17
End Sub
Private Sub Optdiseador_Click()
If Optdiseador Then
SALARIO = 4750
End If
Txtsalario = Str(SALARIO)End Sub
Private Sub Optfemenino_Click()
If Optfemenino Then
BONIFICACION = 450
End If
Txtbonificacion = Str(BONIFICACION)
End Sub
Private Sub Optgerentem_Click()
If Optgerentem Then
SALARIO = 8500
End IfTxtsalario = Str(SALARIO)
End Sub
Private Sub Optgerenten_Click()
If Optgerenten Then
SALARIO = 7750
End If
Txtsalario = Str(SALARIO)
End Sub
Private Sub Optgerentep_Click()
If Optgerentep Then
SALARIO = 10000End If
Txtsalario = Str(SALARIO)
End Sub
Private Sub Optgerentev_Click()
If Optgerentev Then
SALARIO = 9250
End If
Txtsalario = Str(SALARIO)
End Sub
Private Sub Optmasculino_Click()
If Optmasculino ThenBONIFICACION = 350
End If
Txtbonificacion = Str(BONIFICACION)
End Sub
7/28/2019 Guia Progra
17/17
Private Sub Optoperador_Click()
If Optoperador Then
SALARIO = 6250
End If
Txtsalario = Str(SALARIO)End Sub
Private Sub Optsecretaria_Click()
If Optsecretaria Then
SALARIO = 4000
End If
Txtsalario = Str(SALARIO)
End Sub
Private Sub Optvendedor_Click()
If Optvendedor Then
SALARIO = 5500
End IfTxtsalario = Str(SALARIO)
End Sub
Private Sub Txthoraextra_Change()
HORAEXTRA = Val(Txthoraextra)
PAGOEXTRA = 35
TOTALEXTRA = HORAEXTRA * PAGOEXTRA
Txtpagoextra = Str(PAGOEXTRA)
Txttotalextra = Str(TOTALEXTRA)
End Sub