Chapter On1 Ken-1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 50

CHAPTER ONE

INTRODUCTION

1.1 Background of the Study

Student’s result is one of the most important bases for measurement of a student’s

academic performance in school; student’s result is also used to measure a

student’s performance in different courses offered by the student.

Processing a result manually can pose challenges as several mistakes can be made,

any mistake made in the process can lead to a very big problem which may reduce

the ability to grade a student from his/her school result. An adequate processing

system is needed to carry out the result processing so that the aim for which results

are being processed can be achieved. Obviously this will positively affect the

release of results and improve the grading system to its standard. Ken Saro-Wiwa

Polytechnic, Bori, is a tertiary institution in Nigeria that offers various academic

programs. The polytechnic faces challenges in result computation, leading to

delays and inaccuracies. This case study aims to design and implement an efficient

result computation system.

1.2 Statement of Problem

The problems which the manual method of processing result faced include:

 Loss of result when files are been carried from on table to another for

processing.

1
 Computation of results takes longer time.

 Must student’s results are being omitted.

 Wrong calculations during computation.

1.3 Aim and Objectives of the Study

The primary aim of the study is to produce a system that will aid result processing

for all departments in Ken Saro Wiwa Polytechnic and also to protect this system

from unauthorized users from having access to the result of students which can be

achieved by introducing password. The following objectives will help in achieving

the above aim:

1. Design a result computation system that accurately calculates student grades.

2. Implement an automated system that reduces manual errors.

3. Improve result computation speed and transparency.

4. Design a database that will store student’s results.

5. Create a database that will store the password and username of students.

6. Get the details of all the courses taken in the department and their credit

units.

1.4 Significance of the Study

Research carried out in the school shows that results are still being processed

manually. This leads to various problems which include:

 Insecurity of result.

 Duplication of results.

2
 Loss of result when files are been carried from one table to the other.

 Wrong calculations during computation.

 Omission of results

 Delay in computation

This project will achieve the following:

 Increase in deficiency.

 Easy detection and correction of errors.

 Reduce pressure of work on examination officers.

 Makes computation less labour intensive.

1.5 Scope of the Study

The scope of this work is bounded by the Computer Science Department of Ken

saro -Wiwa Polytechnic Bori, but can be used as a guide to develop broader project

of the like of Result Processing System for Ken saro-Wiwa Polytechnic

Exams/Record Department.

1.6 Definition of Terms

RESULT: Gotten derived from something that has already being done

PROCESSING: A method or way of manufacturing something

SYSTEM: A way of organizing something according to certain ideas,

principles etc. it is also an arrangement of many parts that work

together.

3
INFORMATION: Information is that which informs, i.e. an answer to a question,

as well as that from which knowledge and data can be derived.

COMPUTATION: An act of calculating or estimating.

RESEARCH: A careful study of something, especially to discover new facts

or information about it.

4
CHAPTER TWO

LITERATURE REVIEW

2.1 Data Processing Concept

Microsoft Excel spreadsheet program was employed to build an Intelligent

Knowledge-Based System (IKBS), making use of various programming facilities

provided by that application (Excel). The central issue here is that the

programming is typed into the cells, and cell referencing is used to monitor and

track students’ performance (cumulative points, etc.) (Martin, J., 1986):

The system has been reported to be working fine. However, it appears to be rather

restrictive, and calls for substantial expertise in programming. Adobe

Dreamweaver, an Integrated Development Environment, is used to create the

Graphic User Interface and to write the codes. MYSQL Server, a Relational

Database Management System, is used to create the database tables and data.

Personal Home Page Pre-Processor (PHP) is used to communicate with and

manipulate the database. This application, though tested and found to be working

as expected, has however not been put to use widely.

Apart from these two, there are undoubtedly several other similar applications in

existence. There is, however, always room for improvement. This new application

is intended to have reduced complexity and greater ease of use, in order to enhance

maintainability while still retaining good speed and accuracy (Martin, J., 1986).

5
Technically, GPA and CGPA calculation module is a process in the ISIS where

academic staff can use to run the calculation of the grade point of the mark and the

total grade point which has taken by student”. From this process the student result

will be stored in the database. However this process would be done based on

academic regulation and every regulation must be implemented correctly to get the

right result. (Wright, P., 1990)

Data is defined as any collection of facts. Thus sales report, inventory figures, test

scores, customers’ names and addresses, and weather reports are all examples of

data.

Data processing is the manipulation of data into a more useful form. It is the

modern name for paperwork and involves the collecting, processing, and

distributing of facts and figures to achieve a desired result. Data processing

includes not only numerical calculations but also operations such as the

classification of data and transmission of data from one place to another. In

general, we assume that these operations are performed by some type of machine

or computer, although some of them could also be carried out manually. Data

processing system refers to the equipment or devices and procedures by which the

result is achieved.

2.2 Manual System

Although widespread use of the term data processing dates only from the nineteen-

fifties, data processing functions have been performed manually for millennia.

6
Manual method of processing results involves the use of pen, paper, and calculator

in processing. Though this method has been in use for so long, it is gradually

fading away and giving way to the automated result processing.

2.3 Problems of Manual System

Manual method of processing result can poses so many challenges especially when

it involves large data which may take more time to process it can face the

following challenges:

1. Inefficiency in result computation

2. It takes longer time to compute

3. It is stressful

4. Uncertainty in result

5. Omission of result

6. Wrong computation

2.4 Relevance of Computer System in Result Processing

Computer system is relevant in result processing as it aids the computation of

results, and helps in producing error free results compared to the manual method of

result processing. Computer system reduces the problems encountered when using

manual system to process result. Results produce with computer are very

competent.

2.5 Grading System

7
Grading in education is the process of applying standardized measurements of

varying levels of achievement in a course. For evaluation purposes, letter grades

with corresponding numerical values are assigned as follows (see table below):

Table 1: unified grading system

Marks% Letter grade Numerical value of

letter grade

75-100 A 4.00

70-74 AB 3.50

65-69 B 3.25

60-64 BC 3.00

55-59 C 2.75

50-54 CD 2.50

45-49 D 2.25

40-44 E 2.00

Below 40 F 0.00

2.5.1 Grade Point Average

The assessment of a student’s performance shall be based on the Grade Point

Average (GPA). The GPA is the sum of the “Grade Points” (credit points) divided

by the total number of credit hours. A grade is obtained by multiplying the

numerical value of grades in each course by the number of credit hours. A credit

hour is equivalent ot one contact hour/work semester.

8
For example see table below:

Table 2: GPA computation

Course Credit Letter Numerical Grade Point

Numbers hours grade value of (Credit

letter grade Point)

COM111 3 C 2.75 3×2.75=8.25

COM123 4 B 3.25 4×3.25=13

MTH112 2 BC 3.00 2×3.00=6

TOTAL 9 27.25

2.5.2 Cumulative Grade Point Average

To compute a Cumulative Grade Point Average (CGPA) the total for grade points

for all semesters are added and then divided by the total number of credit hours

taken during those semesters.

For example see table below:

Table 3: CGPA computation

Semester Total Credit hours Total grade points

9
1 19 65.30

2 22 55.40

TOTAL 41 120.70

120.70
The CGPA = 41
= 2.94

10
CHAPTER THREE
SYSTEM DESGIN AND ANALYSIS

1.1 Methodology

This project will apply Extreme Programming (XP) methodology to

develop the new module for GPA and CGPA calculation. The

reason choosing this methodology is because the project will be

suitable for the ready system. It just focuses on the enhancement

process and also the modification for the system will be done

when the users need a new requirement. Basically the

requirement for the system is based on the user reports. After

user reports have been written, a release planning meeting will

do the designing base on the user requirement.

1.2 System Design

In the first stage of developing the new approach calculation GPA

and CGPA is the process of designing the system architecture how

to make sure the system will not have hard-code in the source

code. For these reasons, a study has been made to ensure that

the system will achieve this objective. The new approach or new

method that has been emphasized is that the system should be

11
easy to manage when the academic regulation changes. Meaning

to say, a system should write in less hard-coded source coded

while the system was developed.

1.3 Algorithm

Main Menu

Step 1: Start

Step 2: Display program Interface

Step 3: Display login screen

Step 4: Attempt = 0

Step 5: Input Username and

Password

Step 6: If User valid then Display “Welcome”

Else Attempt = Attempt + 1 If Attempt = 3 Then Goto

Step 9

Else Goto Step 5 End If End If

Step 7: Display menu

Step 8: On menu Selection Transfer Control to appropriate

module

Step 9: Stop

ND1 Module
12
Step 1: Start

Step 2: Display program interface

Step 3: Open database

Step 4: Enter matric no.

Step 5: If matric no. valid then Goto Step 6

Else Goto Step 12

End If

Step 6: Display Student Name

Step 7: Enter No. of courses

Step 8: For (I = 0; I < no. of courses; I++) {Call Grade Call

Grade point

TCU = TCU + 1TGP = TGP + 1}

Step 9: Display TCU, TGP

Step 10: CGPA = TGP/TCU

Step 11: Display CGPA

Step 12: Close database

13
Step 13: Return

Grade
Step 1: Initialize variables

Step 2: Input CA, Exam

Step 3: TS = CA + Exam

Step 4: If TS >= 75 Then

Grade = “A”

Else if TS >= 70 Then

Grade = “AB”

Else if TS >= 65 Then

Grade = “B”

Else if TS >= 60 Then

Grade = “BC”

Else if TS >= 55 Then

Grade = “C”

Else if TS >= 50 Then

14
Grade = “CD”

Else if TS >= 45 Then

Grade = “D”

Else if TS >= 40 Then

Grade = “E”

Else if TS> = “39”

Grade = “F”

Step 5: return Grade;

Grade Point

Step 1: Initialize Variables

Step 2: Input CU, Grade

Step 3: If Grade = “A” Then

GP = CU * 4.0

Else If Grade = “AB” Then

GP = CU * 3.5

Else If Grade = “B” Then


GP = CU * 3.25

15
Else If Grade = “BC” Then

GP = CU * 3.0

Else If Grade = “C” Then

GP = CU * 2.75

Else If Grade = “CD” Then

GP = CU * 2.50

Else If Grade = “D” Then

GP = CU * 2.25

Else If Grade = “E” Then

GP = CU * 2.0

Else If Grade = “F” Then

GP = CU * 0.0

Else Display “Invalid Grade”

End If

Step 4: Return

1.4 Flowchart

16
Main Menu

Start

Display program Interface

Initialized counter=0

Display Login Screen

Enter username And Password

Yes
Is username Valid?

NO A

Print “Invalid user”

Counter =Counter+1

No
Is counter = 3?

Yes

Figure 3.1: flow chart for main menu

17
A

Select option
ND I First Semester Result
ND I Second Semester
NDII First Semester
NDII Second Semester
Check Result

Is Option = 1,2,3,4,5 ?

1 ND I 1ST SEMESTER

2
ND1 2NDSEMESTER

3
ND2 FIRST SEMESTER

4
ND2 SECOND SEMESTER

5
ND2 SECOND SEMESTER

BV

Stop

18
Grade point
Grade Point

Input CU, grade

T
Is Grade = “A” ? GP = 4.0*CU

T
Is Grade = “AB” ? GP = 3.50*CU

Is Grade = “B” ? T
GP = 3.25*CU

T
Is Grade = “BC” ?
GP = 3.0*CU

T
Is Grade = “C” ?
GP = 2.75*CU

T
Is Grade = “CD” ?
GP = 2.50*CU

C D

19
Figure 3.2: flowchart for grade point
C
D

Is Grade = “D” ?
T
GP = 2.25*CU

Is Grade = “E” ?
T
GP = 2.0*CU

Is Grade = “F” ?
T
GP = 0.0

RETURN

20
Grade module
Grade

Input CA, EXAM

TS= CA+EXAM

Is TS >= 75 ? T
Grade =”A”

F
Is TS>= 70?
T
Grade= “AB”

F
Is TS>= 65 ?
T
Grade =”B”

F
Is TS>= 60?
T
Grade=”BC”

F
Is TS>=55 ?
T
Grade=”C”

F
Is TS >= 50 ?
T
Grade = “CD

E F

21
Figure 3.3: flowchart for grade

E F

Is TS>=45?
T
Grade=”D”

Is TS>=40?
T
Grade = “E”

Is TS<40?
T
Grade = “F”

RETURN

22
ND1 First Semester Module
ND1 FIRST SEMESTER

Display program interface

Open Database

Enter Matno

IS matno Valid?
No Yes

FOR COURSE= 1
TO
Display “Invalid matno” N

Grade

Grade Point

Display result

Close Database

Return

23
Figure 3.4: flowchart for ND1 first semester

ND2 First Semester Module


ND2 FIRST SEMESTER

Display program interface

Open Database

Enter Matno

IS matno Valid?
No Yes

FOR COURSE= 1
TO
Display “Invalid matno” N

Grade

Grade Point

Display result

Close Database

Return

24
Figure 3.5: flowchart for ND2 first semester

Check result module

Check result

Display program interface

Open database

Display menu
ND 1
ND 2

Is option = 1 Yes

No
Print ND1 result
Is option = 2 Yes

No
Print ND1 result

Select option

Return

Figure 3.5: flowchart for check result module

25
CHAPTER FOUR

SYSTEM IMPLEMENTATION

4.1 Choice of Programming language

The programming language used in coding this project work is

VISUAL BASIC. The visual basic is an interpreter programming

language which contains a powerful diagnostic routine which tells

a programmer he or she has made any error with any of the

feature.

4.1.1 Visual Basic Programming Approach

Microsoft visual basic for windows comes in Learning Edition, a

Profession Edition and an Enterprise Edition. The latter two

are used for developing application involved in advanced

database management. These editions come in version such as

VB 4.0, VB 5.0, VB 6.0 and VB 10.1 (the latest version).

The visual basic programming language differ from other

programming in 3 distinct ways

 Programs are event driven

 VB makes it easy to obtain data from relational database

 It is object oriented with significant support for object

programming

26
4.2 Documentation

System Requirements

In order for the new implemented program to work effectively, it

requires some software and hardware facilities, such as:

 A computer system

 The application program

 UPS (Uninterrupted power supply)

 A storage device

 Antivirus

4.3 Program Source Code

See Appendix A

4.4 Program Output

See Appendix B

27
CHAPTER FIVE

SUMMARY, CONCLUSION AND RECOMMENDATION

5.1 Summary

Computer plays an ever increasing role in all aspects of our lives.

Today the concept of computer programming can be used in

various fields of human specialization to ease work load and

promote productivity. These areas include:

 Design and construction of engines

 Application design

 Telephone system

 Industrial robot

 Toys and games etc.

Moreover computers are used in hospital, banks, and airports.

Some artist and advanced architect are using computer for their

drawing.

The involvement of computers in institutions, especially in the

area of computing students’ CGPA cannot be overemphasized, as

it sums up the whole essence of the student being in the school.

28
5.2 Conclusion

It is obvious that the design of the computerized computation of

students’ CGPA has been successfully designed and implemented.

The new system call for a less work load for the personnel in

charge of computing results and better working conditions

The result computation system designed and implemented for

Ken Saro-Wiwa Polytechnic, Bori, has improved the accuracy,

speed, and transparency of result computation. The system has

reduced manual errors and enhanced student satisfaction.

The benefits to be derived from this computerized means of

computing students’ CGPA cannot be measured in monetary

terms, however the benefits include the efficacy and efficiency of

with which the grades, GPAs, CGPAs of students can be

determined with ease and under minimal time. In this new system

there is accuracy in the result released to the student.

Finally, during the writing of this work, a lot of gainful experiences

were obtained but because of time, equipment and other

constraints, not all intended reports were achieved.

29
5.3 Recommendation

After the researcher’s work has been completed, the researcher

now recommends that the system when implemented will meet

the set objectives. The researcher also recommends that there be

wholesome revision of the information generated after

computation before adding it to the records.

The system can be disturbed by power failure; the availability for

an uninterrupted power supply (UPS) would be advisable as this

will prevent the system from crashing or computing the students’

CGPA over and over again.

During the period of writing this work there were a few jobs left by

the researcher because of time and complexity factor, such as

continuation of the application program etc. therefore the

research successors in the field of computing students CGPA will

continue from where I stopped

30
REFERENCE

Connors, E.T. and T.C. Valesky,(1986): UsingMicrocomputers in

School Administration. Fastback no. 248. Phi Delta Kappa

Educational Foundation,Bloomington.

Garcia-Molina, H., J. Ullman and J. Widom,(2008): Database

Systems: The Complete Book (DS:CB).Prentice-Hall,

Princeton, NJ.

Martin, J., (1986): Fourth-generation languages 4GLs from IBM.

Prentice-Hall, Englewood Cliff, NJ, pp: 2.

Microsoft Corporation (1999): The Microsoft Office 2000 Guide

(Redmond).

Microsoft Corporation(2002): Visual Basic Programmer's Guide.

Retrieved from: http://mspress.microsoft.com.

Microsoft Corporation(2003): Microsoft Office 2003 Step-by-Step

Learning Kit.Retrievedfrom:

http://mspress.microsoft.com/. (12: 01: 2015, 12:24: pm)

31
Silberschatz, A., H.F. Korth and S. Sudarsham(2005): Database

Systems Concepts. 5th Edn., McGraw-Hill, Hightstown, NJ.

Vecchioli, L., (1999): A process for evaluating student records

management software. Prac. Assess. Res. Eval., 6(14).

Wright, P., (1990): Choosing a computer based instructional

support system: An evaluation/selection model. Comp.

Edu., 14(3): 217-225.

32
Splash Screen
Dim i As Integer Private Sub Command1_Click()
Unload Me
Form2.Show End Sub Private Sub Form Key Press (Key Ascii As
Integer)
Unload Me
Form1.Show End Sub
Login
Private Sub Command1_Click ()
If Text1.Text = "" And Text2.Text = "" Then
Msg Box ("Invalid Username or Password")
MsgBox ("Please check proper")
Unload Me
Form2.Show
Text1.SetFocus
ElseIf Text1.Text = "progress" And Text2.Text = "barisi" Then
Form3.Show
Unload Me
End If
End Sub
Private Sub Command2_Click ()
Unload Me
End Sub
Main Menu
Private Orig Color As Long
Private Orig Size As Integer
Option Explicit
Private StrCap As String
33
Private Num As Long
Private Sub cmd2ss_Click()
ND2SECOND.Show
End Sub
Private Sub CmdND1f_Click()
ND1first.Show
End Sub
Private Sub cmdnd1s_Click()
ND1SECOND.Show
End Sub
Private Sub Command4_Click()
Dim logout As String
logout = MsgBox("Are You Sure You want to logout", vbYesNo,
"Exit")
If logout = vbYes Then
Unload Me
Form4.Show
Else If logout = vb No Then
Form3.Show
End If
End Sub
Private Sub cmd nd2f_Click ( )
ND2FIRST.Show
End Sub
Private Sub Command1_Click ( )
ViewND1.Show
End Sub
Private Sub Command2_Click()
34
ViewNN2.Show
End Sub
Private Sub Command3_Click()
Unload Me
Form4.Show
End Sub
Private Sub Form_Load()
StrCap = lblCaption.Caption
End Sub
Private Sub mnuE_Click()
Unload Me
Form4.Show
End Sub
Private Sub MNUND1R_Click()
ViewND1.Show
End Sub
Private Sub MNUND2 R_Click()
ViewNN2. Show End Sub

Private Sub Timer1_Timer ( )


If lbl Caption.Caption <> Str Cap Then
If lbl Caption Alignment = 0
Then 'run from left
Lbl Caption.Caption = Left (StrCap, Len (lbl Caption.Caption) +
1)
Else If lbl Caption. Alignment = 1 Then 'run from right
Lbl Caption. Caption = Right (StrCap, Len(lbl Caption.Caption) +
1)
35
Else If lbl Caption. Alignment = 2 Then 'run from the middle
Lbl Caption. Caption = Mid(StrCap, Len(StrCap) \ 2 +
Len(StrCap) Mod 2 - Num, 2 * (Num + 1) - Len(StrCap) Mod 2)
Num = Num + 1
End If
Else lbl Caption.Caption = Num = 0
End If End Sub

Nd1 First Semester


Private cn As ADODB.Connection
Private rs As ADODB.Record set
Dim ca, ex, CU As Integer
Dim TCU As Integer
Dim TGP As Double
Private Sub CMD COMPUTE_Click()
'ca = Val(CA1.Text)
'ex = Val(EX1.Text)
Call conv(CA1.Text, EX1.Text, CU1.Caption)
LG1.Caption = Grade(ca, ex)
GP1.Caption = Format (Gradepoint (LG1.Caption, CU), "fixed")
Call conv (CA2.Text, EX2.Text, and CU2.Caption)
lg2.Caption = Grade(ca, ex)
GP2.Caption = Format(Gradepoint(lg2.Caption, CU), "fixed")

Call conv(CA3.Text, EX3.Text, CU3.Caption)


Lg3.Caption = Grade(ca, ex)
gp3.Caption = Format (Gradepoint(Lg3.Caption, CU), "fixed")
Call conv(CA4.Text, EX4.Text, CU4.Caption)
36
Lg4.Caption = Grade (ca, ex)
gp4.Caption = Format (Grade point (Lg4.Caption, CU), "fixed")
Call conv(CA5.Text, EX5.Text, CU5.Caption)
Lg5.Caption = Grade(ca, ex)
Gp5.Caption = Format(Gradepoint(Lg5.Caption, CU), "fixed")
Call conv(CA6.Text, EX6.Text, CU6.Caption)
lg6.Caption = Grade(ca, ex)
GP6.Caption = Format(Gradepoint(lg6.Caption, CU), "fixed")
Call conv(CA7.Text, EX7.Text, CU7.Caption)
LG7.Caption = Grade(ca, ex)
GP7.Caption = Format(Gradepoint(LG7.Caption, CU), "fixed")
Call conv(CA8.Text, EX8.Text, CU8.Caption)
lg8.Caption = Grade(ca, ex)
GP8.Caption = Format(Gradepoint(lg8.Caption, CU), "fixed")
Call conv(CA9.Text, EX9.Text, CU9.Caption)
Lg9.Caption = Grade(ca, ex)
gp9.Caption = Format(Gradepoint(Lg9.Caption, CU), "fixed")

Call conv(CA10.Text, EX10.Text, CU10.Caption)


Lg10.Caption = Grade(ca, ex)
gp10.Caption = Format(Gradepoint(Lg10.Caption, CU), "fixed")

TCU = Val(CU1.Caption) + Val(CU2.Caption) +


Val(CU3.Caption) + Val(CU4.Caption) + Val(CU5.Caption) +
Val(CU6.Caption) + Val(CU7.Caption) + Val(CU8.Caption) +
Val(CU9.Caption) + Val(CU10.Caption)
TGP = Val(GP1.Caption) + Val(GP2.Caption) + Val(gp3.Caption)
+ Val(gp4.Caption) + Val(Gp5.Caption) + Val(GP6.Caption) +
37
Val(GP7.Caption) + Val(GP8.Caption) + Val(gp9.Caption) +
Val(gp10.Caption)

LBLTCU.Caption = TCU
LBLTGP.Caption = TGP
'LBLGPA.Caption = TGP / TCU
LBLGPA.Caption = Format(TGP / TCU, "Fixed")
End Sub
Function conv(cca, cex, CCU)
ca = Val(cca)
ex = Val(cex)
CU = Val(CCU)

End Function

Function Grade(ca, ex)


ts = ca + ex
If ts >= 75 Then
Grade = "A"
ElseIf ts >= 70 Then
Grade = "AB"
ElseIf ts >= 65 Then
Grade = "B"
ElseIf ts >= 60 Then
Grade = "BC"
ElseIf ts >= 55 Then
Grade = "C"
38
ElseIf ts >= 50 Then
Grade = "CD"
ElseIf ts >= 45 Then
Grade = "D"
ElseIf ts >= 40 Then
Grade = "E"
Else
Grade = "F"
End If

End Function

Function Gradepoint(Grade, CU)


If Grade = "A" Then
Gradepoint = 4# * CU
ElseIf Grade = "AB" Then
Gradepoint = 3.5 * CU
ElseIf Grade = "B" Then
Gradepoint = 3.25 * CU
ElseIf Grade = "BC" Then
Gradepoint = 3# * CU
ElseIf Grade = "C" Then
Gradepoint = 2.75 * CU
ElseIf Grade = "CD" Then
Gradepoint = 2.5 * CU
ElseIf Grade = "D" Then
Gradepoint = 2.25 * CU
ElseIf Grade = "E" Then
39
Gradepoint = 2# * CU
Else
Gradepoint = 0# * CU
End If

End Function

Private Sub cmdAdd_Click()


txtName.Text = ""
txtType.Text = ""
txtDosage.Text = ""
txtStorage.Text = ""
txtdatem.Text = ""
TxtDateE.Text = ""
TxtFunction.Text = ""
txtNAFDAC.Text = ""
Text1.Text = ""

End Sub

Private Sub cmdExit_Click()


Unload Me
Form3.Show
End Sub
40
Private Sub CMDsAVE_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source= " & App.Path & "\Database.mdb"
cn.CursorLocation = adUseClient
cn.Open

Set rs = New ADODB.Recordset


rs.Open "ND1", cn, adOpenStatic, adLockPessimistic,
adCmdTable
With rs
.MoveFirst
.Find "MAT_NO ='" & TXTMATNO.Text & "'"
If .EOF Then
.AddNew
!Mat_No = TXTMATNO.Text
!StudentName = TXTSTUDENTNAME.Text
!COM111 = LG1.Caption
!COM112 = lg2.Caption
!COM113 = Lg3.Caption
!STA111 = Lg4.Caption
!STA112 = Lg5.Caption
!MTH111 = lg6.Caption
!MTH112 = LG7.Caption
!GNS111 = lg8.Caption
!GNS118 = Lg9.Caption
41
!OTM112 = Lg10.Caption
!TCU = TCU
!TGP = LBLTGP.Caption
!GPA = LBLGPA.Caption
.Update
MsgBox "Student result updated"
Else
MsgBox "Result exist"
Exit Sub
End If
End With
rs.Close
cn.Close
End Sub

Private Sub cmdSearch_Click()


Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" & App.Path & "\database.mdb"
cn.CursorLocation = adUseClient
cn.Open

rs.Open "select * from ND1", cn, adOpenStatic,


adLockOptimistic, adCmdText

42
With rs
Do Until .EOF
If !Mat_No = TXTMATNO.Text Then
'LG1.Caption = !COM111
' Call GRADEPOINT(LG1.Caption)
LBLName.Caption = !StudentName

MsgBox "Search Complete", vbOKOnly, "Successful"


Set rs = New ADODB.Recordset
rs.Open "HND1", cn, adOpenStatic, adLockPessimistic,
adCmdTable

cn.Close
Exit Sub
Else
.MoveNext
End If
Loop
End With
rs.Close
cn.Close
MsgBox "Matriculation number not found", vbOKOnly, "Wrong
Matno"
End Sub

Private Sub Form_Load()


Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
43
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source= " & App.Path & "\database.mdb"
cn.CursorLocation = adUseClient
cn.Open
End Sub

ND1 Second Semester


Private cn As ADODB.Connection
Private rs As ADODB.Recordset
Dim ca, ex, CU As Integer
Dim TCU As Integer
Dim TGP As Double
Private Sub CMDCOMPUTE_Click()
'ca = Val(CA1.Text)
'ex = Val(EX1.Text)

Call conv(CA1.Text, EX1.Text, CU1.Caption)


LG1.Caption = Grade(ca, ex)
GP1.Caption = Format(Gradepoint(LG1.Caption, CU), "fixed")

Call conv(CA2.Text, EX2.Text, CU2.Caption)


lg2.Caption = Grade(ca, ex)
GP2.Caption = Format(Gradepoint(lg2.Caption, CU), "fixed")

Call conv(CA3.Text, EX3.Text, CU3.Caption)


Lg3.Caption = Grade(ca, ex)
gp3.Caption = Format(Gradepoint(Lg3.Caption, CU), "fixed")

44
Call conv(CA4.Text, EX4.Text, CU4.Caption)
Lg4.Caption = Grade(ca, ex)
gp4.Caption = Format(Gradepoint(Lg4.Caption, CU), "fixed")

Call conv(CA5.Text, EX5.Text, CU5.Caption)


Lg5.Caption = Grade(ca, ex)
Gp5.Caption = Format(Gradepoint(Lg5.Caption, CU), "fixed")

Call conv(CA6.Text, EX6.Text, CU6.Caption)


lg6.Caption = Grade(ca, ex)
GP6.Caption = Format(Gradepoint(lg6.Caption, CU), "fixed")

Call conv(CA7.Text, EX7.Text, CU7.Caption)


LG7.Caption = Grade(ca, ex)
GP7.Caption = Format(Gradepoint(LG7.Caption, CU), "fixed")

Call conv(CA8.Text, EX8.Text, CU8.Caption)


lg8.Caption = Grade(ca, ex)
GP8.Caption = Format(Gradepoint(lg8.Caption, CU), "fixed")

Call conv(CA9.Text, EX9.Text, CU9.Caption)


Lg9.Caption = Grade(ca, ex)
gp9.Caption = Format(Gradepoint(Lg9.Caption, CU), "fixed")

'Call conv(CA10.Text, EX10.Text, CU10.Caption)


' LG10.Caption = Grade (ca, ex)
' GP10.Caption = Format(Gradepoint(LG10.Caption, CU),
"fixed") TCU = Val(CU1.Caption) + Val(CU2.Caption) +
45
Val(CU3.Caption) + Val(CU4.Caption) + Val(CU5.Caption) +
Val(CU6.Caption) + Val(CU7.Caption) + Val(CU8.Caption) +
Val(CU9.Caption) ' + Val (CU10.Caption) TGP = Val
(GP1.Caption) + Val (GP2.Caption) + Val(gp3.Caption) +
Val(gp4.Caption) + Val (Gp5.Caption) + Val(GP6.Caption) +
Val(GP7.Caption) + Val (GP8.Caption) + Val(gp9.Caption) ' +
Val(gp10.Caption)

LBLTCU.Caption = TCU
LBLTGP.Caption = TGP
'LBLGPA.Caption = TGP / TCU
LBLGPA.Caption = Format(TGP / TCU, "Fixed")
LBLCGPA.Caption = (Val(GPA1.Caption) +
Val(LBLGPA.Caption)) / 2
End Sub
Function conv(cca, cex, CCU)
ca = Val (cca)
ex = Val (cex)
CU = Val (CCU)
End Function
Function Grade (ca, ex)
ts = ca + ex
If ts >= 75 Then Grade = "A"
Else If ts >= 70 Then Grade = "AB"
Else If ts >= 65 The Grade = "B"
ElseIf ts >= 60 Then
Grade = "BC"
ElseIf ts >= 55 Then
46
Grade = "C"
ElseIf ts >= 50 Then
Grade = "CD"
ElseIf ts >= 45 Then
Grade = "D"
ElseIf ts >= 40 Then
Grade = "E"
Else
Grade = "F"
End If
End Function
Function Grade point (Grade, CU)
If Grade = "A" Then
Gradepoint = 4# * CU
ElseIf Grade = "AB" Then
Gradepoint = 3.5 * CU
ElseIf Grade = "B" Then
Gradepoint = 3.25 * CU
ElseIf Grade = "BC" Then
Gradepoint = 3# * CU
ElseIf Grade = "C" Then
Gradepoint = 2.75 * CU
ElseIf Grade = "CD" Then
Gradepoint = 2.5 * CU
ElseIf Grade = "D" Then
Gradepoint = 2.25 * CU
ElseIf Grade = "E" Then
Gradepoint = 2# * CU
47
Else
Gradepoint = 0# * CU
End If

End Function

Private Sub cmdAdd_Click()


txtName.Text = ""
txtType.Text = ""
txtDosage.Text = ""
txtStorage.Text = ""
txtdatem.Text = ""
TxtDateE.Text = ""
TxtFunction.Text = ""
txtNAFDAC.Text = ""
Text1.Text = ""
End Sub
Private Sub cmdExit_Click()
Unload Me
Form3.Show
End Sub
Private Sub CMDsAVE_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" & App.Path & "\database.mdb"
cn.CursorLocation = adUseClient
cn.Open
48
rs.Open "select * from ND1", cn, adOpenStatic, adLockOptimistic,
adCmdText
With rs
Do Until .EOF
If !Mat_No = TXTMATNO.Text Then
!Mat_No = TXTMATNO.Text
!COM121 = LG1.Caption
!COM122 = lg2.Caption
!COM123 = Lg3.Caption
!COM124 = Lg4.Caption
!COM125 = Lg5.Caption
!COM126 = lg6.Caption
!MTH121 = LG7.Caption
!GNS121 = lg8.Caption
!GNS128 = Lg9.Caption
!TCU2 = TCU
!TGP2 = LBLTGP.Caption
!GPA2 = LBLGPA.Caption
!CGPA = LBLCGPA.Caption
.Update
MsgBox "Search Complete", vbOKOnly, "Successful"
Set rs = New ADODB.Recordse rs.
Open "HND1", cn, ad Open Static, ad Lock Pessimistic, ad
CmdTable
cn.Clos
Exit Sub Else
49
.Move Next

50

You might also like