PublicClass Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
PublicSubNew()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
EndSub
'Form overrides dispose to clean up the component list.
ProtectedOverloadsOverridesSub Dispose(ByVal disposing AsBoolean)
If disposing Then
IfNot (components IsNothing) Then
components.Dispose()
EndIf
EndIf
MyBase.Dispose(disposing)
EndSub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
FriendWithEvents lblDatos As System.Windows.Forms.Label
FriendWithEvents lblNumEst As System.Windows.Forms.Label
FriendWithEvents lblNombre As System.Windows.Forms.Label
FriendWithEvents lblCreditos As System.Windows.Forms.Label
FriendWithEvents lblFormaPago As System.Windows.Forms.Label
FriendWithEvents txtNumEst As System.Windows.Forms.TextBox
FriendWithEvents txtNombre As System.Windows.Forms.TextBox
FriendWithEvents txtCreditos As System.Windows.Forms.TextBox
FriendWithEvents txtCantidad As System.Windows.Forms.TextBox
FriendWithEvents cmdLimpiar As System.Windows.Forms.Button
FriendWithEvents cmdCalcular As System.Windows.Forms.Button
FriendWithEvents cmdTerminar As System.Windows.Forms.Button
FriendWithEvents txtFormaPago As System.Windows.Forms.TextBox
FriendWithEvents lblMetodo As System.Windows.Forms.Label
FriendWithEvents lblTotalEstudiantes As System.Windows.Forms.Label
FriendWithEvents ToolBar1 As System.Windows.Forms.ToolBar
FriendWithEvents lblCantidadPagada As System.Windows.Forms.Label
FriendWithEvents txtTotalPagado As System.Windows.Forms.TextBox
FriendWithEvents lblTotalCreditos As System.Windows.Forms.Label
FriendWithEvents txtTotalCreditos As System.Windows.Forms.TextBox
FriendWithEvents txtTotalEstudiantes As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> PrivateSub InitializeComponent()
Me.lblDatos = New System.Windows.Forms.Label()
Me.lblNumEst = New System.Windows.Forms.Label()
Me.lblNombre = New System.Windows.Forms.Label()
Me.lblCreditos = New System.Windows.Forms.Label()
Me.lblFormaPago = New System.Windows.Forms.Label()
Me.txtNumEst = New System.Windows.Forms.TextBox()
Me.txtNombre = New System.Windows.Forms.TextBox()
Me.txtFormaPago = New System.Windows.Forms.TextBox()
Me.txtCreditos = New System.Windows.Forms.TextBox()
Me.txtCantidad = New System.Windows.Forms.TextBox()
Me.cmdLimpiar = New System.Windows.Forms.Button()
Me.cmdCalcular = New System.Windows.Forms.Button()
Me.cmdTerminar = New System.Windows.Forms.Button()
Me.lblMetodo = New System.Windows.Forms.Label()
Me.lblTotalEstudiantes = New System.Windows.Forms.Label()
Me.txtTotalEstudiantes = New System.Windows.Forms.TextBox()
Me.ToolBar1 = New System.Windows.Forms.ToolBar()
Me.lblCantidadPagada = New System.Windows.Forms.Label()
Me.txtTotalPagado = New System.Windows.Forms.TextBox()
Me.lblTotalCreditos = New System.Windows.Forms.Label()
Me.txtTotalCreditos = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'lblDatos
'
Me.lblDatos.Font = New System.Drawing.Font("Arial", 8.25!, (System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Underline), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblDatos.Location = New System.Drawing.Point(16, 16)
Me.lblDatos.Name = "lblDatos"
Me.lblDatos.Size = New System.Drawing.Size(200, 23)
Me.lblDatos.TabIndex = 0
Me.lblDatos.Text = "Favor entrar los datos del estudiante:"
'
'lblNumEst
'
Me.lblNumEst.Font = New System.Drawing.Font("Arial", 8.25!, (System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Underline), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblNumEst.Location = New System.Drawing.Point(16, 56)
Me.lblNumEst.Name = "lblNumEst"
Me.lblNumEst.Size = New System.Drawing.Size(56, 23)
Me.lblNumEst.TabIndex = 1
Me.lblNumEst.Text = "Num Est:"
Me.lblNumEst.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'lblNombre
'
Me.lblNombre.Font = New System.Drawing.Font("Arial", 8.25!, (System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Underline), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblNombre.Location = New System.Drawing.Point(176, 56)
Me.lblNombre.Name = "lblNombre"
Me.lblNombre.Size = New System.Drawing.Size(56, 23)
Me.lblNombre.TabIndex = 2
Me.lblNombre.Text = "Nombre:"
Me.lblNombre.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'lblCreditos
'
Me.lblCreditos.Font = New System.Drawing.Font("Arial", 8.25!, (System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Underline), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCreditos.Location = New System.Drawing.Point(16, 96)
Me.lblCreditos.Name = "lblCreditos"
Me.lblCreditos.Size = New System.Drawing.Size(56, 23)
Me.lblCreditos.TabIndex = 3
Me.lblCreditos.Text = "Creditos:"
Me.lblCreditos.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'lblFormaPago
'
Me.lblFormaPago.Font = New System.Drawing.Font("Arial", 8.25!, (System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Underline), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblFormaPago.Location = New System.Drawing.Point(184, 96)
Me.lblFormaPago.Name = "lblFormaPago"
Me.lblFormaPago.Size = New System.Drawing.Size(48, 30)
Me.lblFormaPago.TabIndex = 4
Me.lblFormaPago.Text = "Forma Pago:"
Me.lblFormaPago.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txtNumEst
'
Me.txtNumEst.Location = New System.Drawing.Point(80, 56)
Me.txtNumEst.Name = "txtNumEst"
Me.txtNumEst.Size = New System.Drawing.Size(72, 20)
Me.txtNumEst.TabIndex = 5
Me.txtNumEst.Text = ""
'
'txtNombre
'
Me.txtNombre.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtNombre.Location = New System.Drawing.Point(240, 56)
Me.txtNombre.Name = "txtNombre"
Me.txtNombre.Size = New System.Drawing.Size(136, 20)
Me.txtNombre.TabIndex = 6
Me.txtNombre.Text = ""
'
'txtFormaPago
'
Me.txtFormaPago.AutoSize = False
Me.txtFormaPago.Location = New System.Drawing.Point(240, 96)
Me.txtFormaPago.Name = "txtFormaPago"
Me.txtFormaPago.Size = New System.Drawing.Size(24, 24)
Me.txtFormaPago.TabIndex = 7
Me.txtFormaPago.Text = ""
'
'txtCreditos
'
Me.txtCreditos.AutoSize = False
Me.txtCreditos.Location = New System.Drawing.Point(80, 96)
Me.txtCreditos.Name = "txtCreditos"
Me.txtCreditos.Size = New System.Drawing.Size(24, 23)
Me.txtCreditos.TabIndex = 8
Me.txtCreditos.Text = ""
'
'txtCantidad
'
Me.txtCantidad.AutoSize = False
Me.txtCantidad.BackColor = System.Drawing.SystemColors.InactiveBorder
Me.txtCantidad.Location = New System.Drawing.Point(16, 144)
Me.txtCantidad.Name = "txtCantidad"
Me.txtCantidad.Size = New System.Drawing.Size(272, 40)
Me.txtCantidad.TabIndex = 9
Me.txtCantidad.Text = ""
'
'cmdLimpiar
'
Me.cmdLimpiar.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdLimpiar.Location = New System.Drawing.Point(32, 296)
Me.cmdLimpiar.Name = "cmdLimpiar"
Me.cmdLimpiar.Size = New System.Drawing.Size(64, 32)
Me.cmdLimpiar.TabIndex = 10
Me.cmdLimpiar.Text = "&Limpiar"
'
'cmdCalcular
'
Me.cmdCalcular.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdCalcular.Location = New System.Drawing.Point(128, 296)
Me.cmdCalcular.Name = "cmdCalcular"
Me.cmdCalcular.Size = New System.Drawing.Size(64, 32)
Me.cmdCalcular.TabIndex = 11
Me.cmdCalcular.Text = "&Calcular"
'
'cmdTerminar
'
Me.cmdTerminar.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdTerminar.Location = New System.Drawing.Point(224, 296)
Me.cmdTerminar.Name = "cmdTerminar"
Me.cmdTerminar.Size = New System.Drawing.Size(64, 32)
Me.cmdTerminar.TabIndex = 12
Me.cmdTerminar.Text = "&Terminar"
'
'lblMetodo
'
Me.lblMetodo.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblMetodo.Location = New System.Drawing.Point(272, 88)
Me.lblMetodo.Name = "lblMetodo"
Me.lblMetodo.Size = New System.Drawing.Size(112, 40)
Me.lblMetodo.TabIndex = 13
Me.lblMetodo.Text = "(E= efectivo, B=beca, V=veterano, O=otro)"
'
'lblTotalEstudiantes
'
Me.lblTotalEstudiantes.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTotalEstudiantes.Location = New System.Drawing.Point(16, 208)
Me.lblTotalEstudiantes.Name = "lblTotalEstudiantes"
Me.lblTotalEstudiantes.Size = New System.Drawing.Size(72, 24)
Me.lblTotalEstudiantes.TabIndex = 14
Me.lblTotalEstudiantes.Text = "Total De Estudiantes:"
Me.lblTotalEstudiantes.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txtTotalEstudiantes
'
Me.txtTotalEstudiantes.Location = New System.Drawing.Point(96, 208)
Me.txtTotalEstudiantes.Name = "txtTotalEstudiantes"
Me.txtTotalEstudiantes.Size = New System.Drawing.Size(40, 20)
Me.txtTotalEstudiantes.TabIndex = 15
Me.txtTotalEstudiantes.Text = ""
'
'ToolBar1
'
Me.ToolBar1.DropDownArrows = True
Me.ToolBar1.Name = "ToolBar1"
Me.ToolBar1.ShowToolTips = True
Me.ToolBar1.Size = New System.Drawing.Size(424, 39)
Me.ToolBar1.TabIndex = 16
'
'lblCantidadPagada
'
Me.lblCantidadPagada.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCantidadPagada.Location = New System.Drawing.Point(168, 208)
Me.lblCantidadPagada.Name = "lblCantidadPagada"
Me.lblCantidadPagada.Size = New System.Drawing.Size(64, 24)
Me.lblCantidadPagada.TabIndex = 17
Me.lblCantidadPagada.Text = "Cantidad Pagada:"
Me.lblCantidadPagada.TextAlign = System.Drawing.ContentAlignment.BottomRight
'
'txtTotalPagado
'
Me.txtTotalPagado.Location = New System.Drawing.Point(240, 208)
Me.txtTotalPagado.Name = "txtTotalPagado"
Me.txtTotalPagado.Size = New System.Drawing.Size(88, 20)
Me.txtTotalPagado.TabIndex = 18
Me.txtTotalPagado.Text = ""
'
'lblTotalCreditos
'
Me.lblTotalCreditos.Font = New System.Drawing.Font("Arial", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblTotalCreditos.Location = New System.Drawing.Point(16, 248)
Me.lblTotalCreditos.Name = "lblTotalCreditos"
Me.lblTotalCreditos.Size = New System.Drawing.Size(72, 24)
Me.lblTotalCreditos.TabIndex = 19
Me.lblTotalCreditos.Text = "Total Creditos"
Me.lblTotalCreditos.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txtTotalCreditos
'
Me.txtTotalCreditos.Location = New System.Drawing.Point(96, 248)
Me.txtTotalCreditos.Name = "txtTotalCreditos"
Me.txtTotalCreditos.Size = New System.Drawing.Size(40, 20)
Me.txtTotalCreditos.TabIndex = 20
Me.txtTotalCreditos.Text = ""
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(424, 342)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtTotalCreditos, Me.lblTotalCreditos, Me.txtTotalPagado, Me.lblCantidadPagada, Me.ToolBar1, Me.txtTotalEstudiantes, Me.lblTotalEstudiantes, Me.lblMetodo, Me.cmdTerminar, Me.cmdCalcular, Me.cmdLimpiar, Me.txtCantidad, Me.txtCreditos, Me.txtFormaPago, Me.txtNombre, Me.txtNumEst, Me.lblFormaPago, Me.lblCreditos, Me.lblNombre, Me.lblNumEst, Me.lblDatos})
Me.Name = "Form1"
Me.Text = "Matricula"
Me.ResumeLayout(False)
EndSub
#EndRegion
'Programa para Calcular la cantidad a pagar por concepto de matricula, ademas de acumular los datos por estudiantes para cada valor
'Declaracion de "class variables" para la acumulacion de los datos
Dim TotalPagado AsDouble
Dim TotalCreditos AsDouble
Dim n AsInteger
PrivateSub cmdCalcular_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCalcular.Click
'Obtener los valores del estudiante
Dim numEst, nombre AsString
Dim Dinero AsDouble
Dim creditos AsSingle
Dim formaPago AsString
Dim cantidad AsSingle
numEst = txtNumEst.Text
nombre = txtNombre.Text
creditos = Val(txtCreditos.Text)
formaPago = txtFormaPago.Text
n = Val(txtTotalEstudiantes.Text)
TotalCreditos = Val(txtTotalCreditos.Text)
'Calcular la cantidad a pagar
If UCase(formaPago) = "E" Then
If creditos >= 12 Then
cantidad = 100 + 90 * creditos
Else
cantidad = 200 + 90 * creditos
EndIf
Else
If UCase(formaPago) = "B" Then
cantidad = 200
Else
If creditos >= 12 Then
cantidad = 100 + 70 * creditos
Else
cantidad = 200 + 70 * creditos
EndIf
EndIf
EndIf
'Funciones para la acumulacion de datos a ser desplegados mas adelante
n = n + 1
TotalCreditos = TotalCreditos + creditos
TotalPagado = TotalPagado + cantidad
'Desplegar la cantidad a pagar y los totales para cada uno de los campos
txtCantidad.Text = "La cantidad a pagar por " & nombre & " es " & FormatCurrency(cantidad, 2)
txtTotalEstudiantes.Text = n
txtTotalCreditos.Text = TotalCreditos
txtTotalPagado.Text = FormatCurrency(TotalPagado, 2)
EndSub
PrivateSub cmdLimpiar_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cmdLimpiar.Click
'Limpiar los objetos antes de entrar nuevos datos
txtNumEst.Text = ""
txtNombre.Text = ""
txtCreditos.Text = ""
txtFormaPago.Text = ""
txtCantidad.Text = ""
EndSub
PrivateSub cmdTerminar_Click(ByVal sender AsObject, ByVal e As System.EventArgs) Handles cmdTerminar.Click
'Terminar el programa
End
EndSub
EndClass