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

Programación

The document describes a university assignment to create a program for calculating student grades. The program uses a data grid to display student data including names, IDs, test scores and calculated averages. Buttons are included to generate the grid, calculate results and end the program.

Uploaded by

Lineth Canto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Programación

The document describes a university assignment to create a program for calculating student grades. The program uses a data grid to display student data including names, IDs, test scores and calculated averages. Buttons are included to generate the grid, calculate results and end the program.

Uploaded by

Lineth Canto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

REPÚBLICA DE PANAMÁ

UNIVERSIDAD TECNOLÓGICA DE PANAMÁ

SEDE AZUERO

INGENIERÍA CIVIL

INGENIERÍA MARÍTIMA PORTUARIA

ASIGNACION “CONTROL DE CALIFICACIONES”

Integrantes:
• Lineth canto 6-726-967
• José frías 6-725-2303
• Yaribeth Quiroz 6-726-1098
• Oliver Samaniego 6-725-676

Facilitadora: Marquela de Cohen

Grupo: 71C121

Año: 2023
Diseño

Código
Public Class Form1
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles txtPromGrupo.TextChanged
End Sub
Private Sub Label8_Click(sender As Object, e As EventArgs) Handles
Label8.Click
End Sub
Private Sub DataGridView_CellContentClick(sender As Object, e As
DataGridViewCellEventArgs) Handles Tabla1.CellContentClick
End Sub
Private Sub TextBox8_TextChanged(sender As Object, e As EventArgs) Handles txtCantD.TextChanged
End Sub
Private Sub cmdGenerar_Click(sender As Object, e As EventArgs) Handles cmdGenerar.Click
Dim CantEstudiantes As Integer, I As Integer
CantEstudiantes = Val(txtCantidad.Text)
Tabla1.RowCount = CantEstudiantes
Tabla1.ColumnCount = 10
Tabla1.RowHeadersWidth = 70
Tabla1.RowHeadersDefaultCellStyle.Font = New Font("Arial Narrow", 10,
FontStyle.Bold)
For I = 1 To CantEstudiantes
Tabla1.Rows(I - 1).HeaderCell.Value = Str(I)
Next
Tabla1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
Tabla1.ColumnHeadersDefaultCellStyle.Font = New Font("Arial", 9,
FontStyle.Bold)
Tabla1.Columns(0).HeaderText = "Apellido"
Tabla1.Columns(0).Name = "Apellido"
Tabla1.Columns(0).Width = 125
Tabla1.Columns(1).HeaderText = "Nombre"
Tabla1.Columns(1).Name = "Nombre"
Tabla1.Columns(1).Width = 125
Tabla1.Columns(2).HeaderText = "Cedula"
Tabla1.Columns(2).Name = "Cedula"
Tabla1.Columns(2).Width = 125
Tabla1.Columns(3).HeaderText = "Parcial No.1 "
Tabla1.Columns(3).Name = "Parcial1"
Tabla1.Columns(3).Width = 75
Tabla1.Columns(4).HeaderText = "Parcial No.2 "
Tabla1.Columns(4).Name = "Parcial2"
Tabla1.Columns(4).Width = 75
Tabla1.Columns(5).HeaderText = "Parcial No.3 "
Tabla1.Columns(5).Name = "Parcial3"
Tabla1.Columns(5).Width = 75
Tabla1.Columns(6).HeaderText = "Ex Final "
Tabla1.Columns(6).Name = "Final"
Tabla1.Columns(6).Width = 75
Tabla1.Columns(7).HeaderText = "Prom Parciales "
Tabla1.Columns(7).Name = "PromParc"
Tabla1.Columns(7).Width = 75
Tabla1.Columns(8).HeaderText = "Prom Final "
Tabla1.Columns(8).Name = "PROMEDIO"
Tabla1.Columns(8).Width = 75
Tabla1.Columns(7).ReadOnly = True
Tabla1.Columns(8).ReadOnly = True
Tabla1.Columns(9).ReadOnly = True
Tabla1.Columns(6).DefaultCellStyle.BackColor = Color.Yellow
Tabla1.Columns(7).DefaultCellStyle.BackColor = Color.YellowGreen
Tabla1.Columns(8).DefaultCellStyle.BackColor = Color.Aquamarine
Tabla1.Columns(9).DefaultCellStyle.BackColor = Color.Blue
Tabla1.Columns(9).DefaultCellStyle.ForeColor = Color.White
Tabla1.Columns(9).DefaultCellStyle.Font = New Font("Arial", 11,
FontStyle.Bold)
Tabla1.DefaultCellStyle.Alignment =
DataGridViewContentAlignment.MiddleCenter
End Sub
Private Sub cmdCalcular_Click(sender As Object, e As EventArgs) Handles cmdCalcular.Click
Dim Parcial_1 As Single, Parcial_2 As Single, Parcial_3 As Single
Dim PromParc As Single, ExFinal As Single, PromFinal As Single
Dim Calif As String, PromGrupo As Single
Dim Desviacion As Single, SumDesviacion As Single
Dim I As Integer, Cant_A As Integer, SumPromFinal As Single
Dim Cant_B As Integer
Dim Cant_C As Integer
Dim Cant_D As Integer
Dim Cant_F As Integer
Dim CantEst As Integer
CantEst = Val(txtCantidad.Text)
For I = 0 To CantEst - 1
Parcial_1 = Val(Tabla1.Rows(I).Cells(3).Value)
Parcial_2 = Val(Tabla1.Rows(I).Cells(4).Value)
Parcial_3 = Val(Tabla1.Rows(I).Cells(5).Value)
ExFinal = Val(Tabla1.Rows(I).Cells(6).Value)
PromParc = (Parcial_1 - 1 + Parcial_1 - 2 + Parcial_3) / 3
PromFinal = PromParc * 0.6 + ExFinal * 0.4
SumPromFinal = SumPromFinal + PromFinal
If PromFinal >= 91 Then
Calif = "A"
Cant_A = Cant_A + 1
ElseIf PromFinal >= 81 Then
Calif = "B"
Cant_B = Cant_B + 1
ElseIf PromFinal >= 71 Then
Calif = "C"
Cant_C = Cant_C + 1
ElseIf PromFinal >= 61 Then
Calif = "D"
Cant_D = Cant_D + 1
Else
Calif = "F"
Cant_F = Cant_F + 1
End If
Tabla1.Rows(I).Cells(7).Value = PromParc
Tabla1.Rows(I).Cells(8).Value = PromFinal
Tabla1.Rows(I).Cells(9).Value = Calif
Next
Tabla1.Columns(7).DefaultCellStyle.Format = "0.00"
Tabla1.Columns(8).DefaultCellStyle.Format = "0.00"
PromGrupo = SumPromFinal / CantEst
For I = 0 To CantEst - 1
PromFinal = Tabla1.Rows(I).Cells(8).Value
SumDesviacion = SumDesviacion + (PromFinal - PromGrupo) ^ 2
Next
Desviacion = Math.Sqrt(SumDesviacion / CantEst) txtPromGrupo.Text = Format(PromGrupo,
"0.00") txtDesviacion.Text = Format(Desviacion, "0.00")
TxtCantA.Text = Cant_A TxtCantB.Text = Cant_B
txtCantC.Text = Cant_C txtCantD.Text = Cant_D
txtCantF.Text = Cant_F
End Sub
Private Sub cmdFin_Click(sender As Object, e As EventArgs) Handles cmdFin.Click End
End Sub
End Class
Ejecución

You might also like