Source Code
Source Code
Imports System.Data.OleDb
PublicClassfrmRegistration
Const English AsInteger = 2
Const GeneralBiology AsInteger = 3
Const GeneralChemistry AsInteger = 2
ConstGeneralChemistryII AsInteger = 3
Const PracticalChemistry AsInteger = 1
Const ElemenatryMaths AsInteger = 3
Const GeneralPhysics AsInteger = 3
Const BasicPracticalPhysics AsInteger = 1
Const IntroductionToStatistics AsInteger = 3
Const NigerianCulture AsInteger = 2
Const Biothics AsInteger = 1
Dim tempEnglish, tempBiology, tempChemistry, tempChemistryII,
tempPracticalChemistry, tempElementaryMaths AsIntegerDim
tempGeneralPhysics, tempPracticalPhysics,
tempIntroductionStatistic, tempNigerianPeople, tempBiothics AsInteger
Dim tempCourseTotal AsInteger
Dim tempGP AsDecimal
DimtempEnglishII, tempFrench, tempGeneralPhysicsII,
tempPhysicsLaboratory, tempBasicChemistry, tempIntroductionComputer
AsInteger
Dim tempElementaryMathsII, tempElementaryMathsIII AsInteger
PrivateSub CalculateGetGP()
'get and map the grade point of txtenglish
If txtEnglish.Text = "A"Then
'return 5 tempEnglish
=5
ElseIf txtEnglish.Text = "B"Then
'return 4 tempEnglish
=4
ElseIf txtEnglish.Text = "C"Then'return 3
tempEnglish = 3
1
ElseIf txtEnglish.Text = "D"Then
'return 2 tempEnglish = 2
ElseIf txtEnglish.Text = "E"Then
'Return 1 tempEnglish = 1
ElseIftxtEnglish.Text = "F"Then
'return 0 tempEnglish
=0
EndIf
3
tempPracticalChemistry = 4
ElseIftxtPracticalChemistry.Text = "C"Then
'return 3
tempPracticalChemistry = 3
ElseIf txtPracticalChemistry.Text = "D"Then
'return 2
tempPracticalChemistry = 2
ElseIf txtPracticalChemistry.Text = "E"Then
'return 1
tempPracticalChemistry = 1
ElseIf txtPracticalChemistry.Text = "F"Then
'return 0
tempPracticalChemistry = 0
EndIf
ElseIf
4
'return 4
ElseIf
ElseIf
EndIf
ElseIf
5
'return 4
ElseIf
ElseIf
'return 3
tempPracticalPhysics = 3
ElseIf txtPracticalPhysics.Text = "D"Then
'Return 2
tempPracticalPhysics = 2
ElseIf txtPracticalPhysics.Text = "E"Then
tempGeneralPhysics = 1
ElseIf txtPracticalPhysics.Text = "F"Then
'return 0
tempPracticalPhysics = 0
EndIf
ElseIf
6
'return 4
ElseIf
ElseIf
tempIntroductionStatistic = 0
EndIf
If
ElseIf
7
'return 4
ElseIf
ElseIf
tempBiothics = 4
txtBiothics.Text = "C"Then
'return 3 tempBiothics = 3
txtBiothics.Text = "D"Then
'return 2
tempBiothics = 2
ElseIf txtBiothics.Text = "E"Then
'return 1
tempBiothics = 1
ElseIf txtBiothics.Text = "F"Then
'return 0
tempBiothics = 0
EndIf
'get the total score from each course
tempCourseTotal = tempEnglish + tempBiology + tempChemistry
+ tempChemistryII + tempPracticalChemistry + _
tempElementaryMaths + tempGeneralPhysics +
tempPracticalPhysics + tempIntroductionStatistic
+_ tempNigerianPeople + tempBiothics
'get the current grade point of the student
tempGP = tempCourseTotal / 11
txtGradepoint.Text = FormatNumber(tempGP, 2)
EndSub
PrivateSub SaveDataToDatabase()
ElseIf
8
'return 4
ElseIf
ElseIf
TRANSConnection()
Dim con AsNewOleDbConnection(connection)
Dim sqlcmd AsString
con.Open()
sqlcmd = "INSERT INTO SEMESTERRECORD "& _
"(NAME,DATEOFBIRTH,LOCALGOVERNMENT,STATEOFORIGIN,RESIDEN
TIALADDRESS,TELEPHONENUMBER,"& _
"NEXTOFKIN,RELATIONSHIP,REGISTRATIONNUMBER,FACULTY,DEPART
MENT,CURRENTLEVEL,"& _
"SEMESTER,CURRENTGRADEPOINT,ENGLISH,BIOLOGY,GENERALCHEMI
STRY,GENERALCHEMISTRYII,PRACTICALCHEMISTRY,"& _
"ELEMENTARYMATHS,GENERALPHYSICS,BASICPRACTICALPHYSICS,INT
ROSTATISTICS,NIGERIANPEOPLE,BIOTHICS)"& _
"VALUES('"& txtName.Text &"','"& txtDateofBirth.Text &"','"
& txtLocalGov.Text &"','"& txtState.Text &"','"& _
txtResidentialAddress.Text &"','"& txtTelephone.Text &"','"&
txtNextofkin.Text &"','"& _ cboRelationship.Text &"','"&
txtRegistrationNumber.Text &
"','"& cboFaculty.Text &"','"& _
cboDepartment.Text &"','"& cboLevel.Text &"','"&
cboSemester.Text &"','"& txtGradepoint.Text & _
"','"& txtEnglish.Text &"','"& txtBiology.Text &"','"&
If
ElseIf
9
'return 4
ElseIf
ElseIf
EndSub
If
ElseIf
10
'return 4
ElseIf
ElseIf
EndSub
If
ElseIf
11
'return 4
ElseIf
ElseIf
APPLICATION CONFIGURATION
<?xmlversion="1.0"?>
<configuration>
<system.diagnostics>
<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<sourcename="DefaultSource"switchName="DefaultSwitch">
If
ElseIf
12
'return 4
ElseIf
ElseIf
<listeners>
<addname="FileLog"/>
<!-- Uncomment the below section to write to the
Application Event Log -->
<!--<add name="EventLog"/>-->
</listeners>
</source>
</sources><switches>
<addname="DefaultSwitch"value="Information"/>
</switches>
<sharedListeners><addname="FileLog"type="Microsof
t.VisualBasic.Logging.FileLogTraceListener,
Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL"initializeData="FileLogWriter"/>
<!-- Uncomment the below section and replace
APPLICATION_NAME with the name of your application to write to the
Application Event Log -->
<!--<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener"
initializeData="APPLICATION_NAME"/>-->
</sharedListeners>
</system.diagnostics>
<startup><supportedRuntimeversion="v4.0"
sku=".NETFramework,Version=v4.0"/></startup></
configuration>APPENDIX 2 (INTERFACES)
If
ElseIf
13
'return 4
ElseIf
ElseIf
If
ElseIf
14