****Please Write in Visual Basic** Design a program to allow a student to access
ID: 3775243 • Letter: #
Question
****Please Write in Visual Basic**
Design a program to allow a student to access current grades and/or create a "What-if" situation on a continuing basis to understand where they are at any given point in the semester. You will need to calculate multiple grades for exams, quizzes and assignments. Single grades will be calculated for attendance and a final semester project. 1. Record grades with the following attributes:
a. First name, middle initial and last name
b. SS # (can be fabricated)
c. 2 exams
d. 4 quizzes
e. 6 assignments
f. A final project
g. Attendance
h. Numeric grade
Convert numeric grade to alphabetic grade (A, B, etc).
Alphabetic grade Calculate Final Grade (numeric portion) using the following scale:
a. Assignments 20 %
b. 2 Exams 30 %
c. Semester Project 25 %
d. Attendance 10 % (19 classes = 100 % attendance)
e. 4 Quizzes 15 %
f. Total 100 %
Explanation / Answer
program Begin VB.Form frmStudentInformation
BorderStyle = 1 'Fixed Single
Caption = "Add/Edit Student Information"
ClientHeight = 7590
ClientLeft = 3570
ClientTop = 2415
ClientWidth = 7890
BeginProperty Font
Name = "Palatino Linotype"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000F&
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7590
ScaleWidth = 7890
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox txtStudid
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H8000000F&
Height = 390
Left = 2220
Locked = -1 'True
TabIndex = 0
Top = 795
Width = 1515
End
Begin VB.CommandButton cmdAddNew
Caption = "Add New"
Height = 465
Left = 3630
TabIndex = 31
Top = 6960
Width = 1215
End
Begin VB.CommandButton cmdSave
Caption = "Save"
Height = 465
Left = 5025
TabIndex = 30
Top = 6930
Width = 1215
End
Begin VB.CommandButton cmdClose
Caption = "Close"
Height = 465
Left = 6405
TabIndex = 29
Top = 6930
Width = 1215
End
Begin VB.Frame Frame1
Caption = "Guardian"
Height = 1755
Left = 345
TabIndex = 21
Top = 4245
Width = 7275
Begin VB.TextBox txtGName
Height = 390
Left = 1665
Locked = -1 'True
TabIndex = 24
Top = 285
Width = 5400
End
Begin VB.TextBox txtGAddress
Height = 390
Left = 1680
Locked = -1 'True
TabIndex = 23
Top = 765
Width = 5400
End
Begin VB.TextBox txtGOccupation
Height = 390
Left = 1680
Locked = -1 'True
TabIndex = 22
Top = 1215
Width = 5430
End
Begin VB.Label Label12
Caption = "Occupation"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 270
TabIndex = 27
Top = 1245
Width = 2490
End
Begin VB.Label Label10
Caption = "Address:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 285
TabIndex = 26
Top = 765
Width = 2235
End
Begin VB.Label Label4
Caption = "Name:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 285
TabIndex = 25
Top = 315
Width = 2235
End
End
Begin VB.ComboBox cboAcademic
Height = 390
ItemData = "frmStudentInformation.frx":0000
Left = 5985
List = "frmStudentInformation.frx":0013
Locked = -1 'True
Style = 2 'Dropdown List
TabIndex = 10
Top = 6120
Width = 1680
End
Begin VB.ComboBox cbolevel
Height = 390
ItemData = "frmStudentInformation.frx":0058
Left = 2010
List = "frmStudentInformation.frx":0068
Locked = -1 'True
Style = 2 'Dropdown List
TabIndex = 9
Top = 6150
Width = 1545
End
Begin VB.TextBox txtAge
Height = 390
Left = 5955
Locked = -1 'True
TabIndex = 8
Top = 3270
Width = 1590
End
Begin VB.ComboBox cboGender
Height = 390
ItemData = "frmStudentInformation.frx":009E
Left = 1950
List = "frmStudentInformation.frx":00A8
Locked = -1 'True
Style = 2 'Dropdown List
TabIndex = 7
Top = 2760
Width = 1695
End
Begin VB.TextBox txtBDAte
Height = 390
Left = 1965
Locked = -1 'True
TabIndex = 6
Top = 3255
Width = 1680
End
Begin VB.TextBox txtBPlace
Height = 390
Left = 1980
Locked = -1 'True
TabIndex = 5
Top = 3765
Width = 5595
End
Begin VB.TextBox txtAddress
Height = 390
Left = 1935
Locked = -1 'True
TabIndex = 4
Top = 2265
Width = 5535
End
Begin VB.TextBox txtLName
Height = 390
Left = 5280
Locked = -1 'True
TabIndex = 3
Top = 1365
Width = 2250
End
Begin VB.TextBox txtMName
Height = 390
Left = 2880
Locked = -1 'True
TabIndex = 2
Top = 1365
Width = 2250
End
Begin VB.TextBox txtFname
Height = 390
Left = 465
Locked = -1 'True
TabIndex = 1
Top = 1380
Width = 2250
End
Begin VB.Label Label16
Caption = "mm/dd/yyyy"
BeginProperty Font
Name = "Palatino Linotype"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 255
Left = 3720
TabIndex = 33
Top = 3360
Width = 1335
End
Begin VB.Label Label15
Caption = "Student ID No.:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 405
TabIndex = 32
Top = 795
Width = 2235
End
Begin VB.Line Line1
BorderColor = &H00808080&
BorderWidth = 3
X1 = -30
X2 = 7890
Y1 = 6750
Y2 = 6750
End
Begin VB.Label Label14
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Student information"
BeginProperty Font
Name = "Engravers MT"
Size = 15.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 510
Left = 60
TabIndex = 28
Top = 120
Width = 7785
End
Begin VB.Label Label13
Caption = "Academic Year"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 4170
TabIndex = 20
Top = 6165
Width = 2445
End
Begin VB.Label Label11
Caption = "Year Level:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 390
TabIndex = 19
Top = 6150
Width = 1425
End
Begin VB.Label Label9
Caption = "Birth Place"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 405
TabIndex = 18
Top = 3810
Width = 2235
End
Begin VB.Label Label8
Caption = "Age:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 5400
TabIndex = 17
Top = 3285
Width = 2235
End
Begin VB.Label Label7
Caption = "Birth Date:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 405
TabIndex = 16
Top = 3330
Width = 2235
End
Begin VB.Label Label6
Caption = "Address:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 435
TabIndex = 15
Top = 2295
Width = 2235
End
Begin VB.Label Label5
Caption = "Gender:"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 405
TabIndex = 14
Top = 2820
Width = 2235
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "Last Name"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 5295
TabIndex = 13
Top = 1785
Width = 2235
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "Middle Name"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 2880
TabIndex = 12
Top = 1770
Width = 2235
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "First Name"
BeginProperty Font
Name = "Palatino Linotype"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 465
TabIndex = 11
Top = 1785
Width = 2235
End
Begin VB.Shape Shape1
BackColor = &H00C0C0C0&
BorderColor = &H00C0C0C0&
FillColor = &H00C0C0C0&
FillStyle = 0 'Solid
Height = 690
Left = 0
Top = -45
Width = 8160
End
End
Attribute VB_Name = "frmStudentInformation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public AddNewInfo As Boolean
Public SearchInfo As Integer
Private Sub cmdAddNew_Click()
ClearObject
UnlockedObject
txtFname.TabIndex = 0
cmdSave.Enabled = True
With DEconnect.rsStudent
.Filter = adFilterNone
.Open
If .RecordCount > 0 Then
.MoveLast
txtStudid.Text = !idnumber + 1
Else
txtStudid.Text = 1
End If
.Close
End With
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub LockedObject()
'txtStudid.Locked = True
txtFname.Locked = True
txtMName.Locked = True
txtLName.Locked = True
txtAddress.Locked = True
cboGender.Locked = True
txtBDAte.Locked = True
txtAge.Locked = True
txtBPlace.Locked = True
txtGName.Locked = True
txtGAddress.Locked = True
txtGOccupation.Locked = True
cboLevel.Locked = True
cboAcademic.Locked = True
End Sub
Private Sub UnlockedObject()
'txtStudid.Locked = False
txtFname.Locked = False
txtMName.Locked = False
txtLName.Locked = False
txtAddress.Locked = False
cboGender.Locked = False
txtBDAte.Locked = False
txtAge.Locked = False
txtBPlace.Locked = False
txtGName.Locked = False
txtGAddress.Locked = False
txtGOccupation.Locked = False
cboLevel.Locked = False
cboAcademic.Locked = False
End Sub
Private Sub ClearObject()
'txtStudid.Text = ""
txtFname.Text = ""
txtMName.Text = ""
txtLName.Text = ""
txtAddress.Text = ""
txtBDAte.Text = ""
txtAge.Text = ""
txtBPlace.Text = ""
txtGName.Text = ""
txtGAddress.Text = ""
txtGOccupation.Text = ""
End Sub
Private Sub cmdSave_Click()
If IsNumeric(txtStudid.Text) = True Then
With DEconnect.rsStudent
.Filter = "idnumber = " & SearchInfo
.Open , , adOpenDynamic, adLockOptimistic
If cmdSave.Caption = "Save" Then .AddNew
'!studidno = txtStudid.Text
!fname = txtFname.Text
!mname = txtMName.Text
!lname = txtLName.Text
!address = txtAddress.Text
!gender = cboGender.Text
!Age = txtAge.Text
!BirthDate = txtBDAte.Text
!BirthPlace = txtBPlace.Text
!yearlevel = cboLevel.Text
!GuardianName = txtGName.Text
!GuardianAddress = txtGAddress.Text
!GuardianOccupation = txtGOccupation.Text
!AcademicYear = cboAcademic.Text
.Update
MsgBox "generate"
cmdSave.Enabled = False
.Close
End With
Else
MsgBox "Input valid ID Number.", vbInformation
End If
End Sub
Private Sub Form_Load()
Select Case AddNewInfo
Case True
cmdAddNew_Click
cmdSave.Caption = "Save"
cboLevel.Text = frmListofStudent.cboLevel
cboAcademic.Text = frmListofStudent.cboSY
Case False
SearchInformation
UnlockedObject
cmdSave.Caption = "Update"
SendKeys "{home}+{end}"
End Select
End Sub
Private Sub txtBDAte_LostFocus()
If IsDate(txtBDAte.Text) = True Then
txtBDAte.Text = Format(txtBDAte.Text, "dd/mm/yyyy")
txtAge.Text = FormatNumber((Date - CDate(txtBDAte.Text)) / 365.25, 0)
End If
End Sub
Private Sub SearchInformation()
With DEconnect.rsStudent
.Filter = "Idnumber = " & frmListofStudent.ListView1.SelectedItem
.Open
SearchInfo = !idnumber
txtStudid.Text = !idnumber
txtFname.Text = !fname
txtMName.Text = !mname
txtLName.Text = !lname
txtAddress.Text = !address
cboGender.Text = !gender
txtAge.Text = !Age
txtBDAte.Text = !BirthDate
txtBPlace.Text = !BirthPlace
cboLevel.Text = !yearlevel
txtGName.Text = !GuardianName
txtGAddress.Text = !GuardianAddress
txtGOccupation.Text = !GuardianOccupation
cboAcademic.Text = !AcademicYear
.Close
End With
End Sub
Private Sub txtmname_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtLName.SetFocus
If KeyCode = 38 Then txtFname.SetFocus
End Sub
Private Sub txtlname_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtAddress.SetFocus
If KeyCode = 38 Then txtMName.SetFocus
End Sub
Private Sub txtFname_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtMName.SetFocus
If KeyCode = 38 Then txtFname.SetFocus
End Sub
Private Sub txtStudid_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtFname.SetFocus
End Sub
Private Sub txtaddress_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then cboGender.SetFocus
If KeyCode = 38 Then txtLName.SetFocus
End Sub
Private Sub txtbdate_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtBPlace.SetFocus
If KeyCode = 38 Then cboGender.SetFocus
End Sub
Private Sub txtbplace_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtGName.SetFocus
If KeyCode = 38 Then txtBDAte.SetFocus
End Sub
Private Sub txtgname_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtGAddress.SetFocus
If KeyCode = 38 Then txtBPlace.SetFocus
End Sub
Private Sub txtgaddress_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then txtGOccupation.SetFocus
If KeyCode = 38 Then txtGName.SetFocus
End Sub
Private Sub txtgoccupation_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 40 Then cboLevel.SetFocus
If KeyCode = 38 Then txtGAddress.SetFocus
End Sub
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.