You are on page 1of 82

A SOFTWARE APPROACH TO STUDENTS GRADE POINT AVERAGE (GPA) COMPUTATION (A CASE STUDY OF THE DEPARTMENT OF COMPUTER SCIENCE)

BY

AKPORIDO OGHENETEGA

DELTA STATE UNIVERSITY ABRAKA

NOVEMBER 2011
A SOFTWARE APPROACH TO STUDENTS GRADE POINT AVERAGE (GPA) COMPUTATION (A CASE STUDY OF THE DEPARTMENT OF COMPUTER SCIENCE)

BY

AKPORIDO OGHENETEGA FOS/08/09/151845

A RESEARCH REPORT SUBMITTED TO THE DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE, FACULTY OF SCIENCE, DELTA STATE UNIVERSITY, ABRAKA

IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD OF THE DEGREE OF BACHELOR OF SCIENCE (B. Sc) IN COMPUTER SCIENCE

ii

NOVEMBER 2011

iii

CERTIFICATION A SOFTWARE APPROACH TO STUDENTS GRADE POINT AVERAGE (GPA) COMPUTATION (A CASE STUDY OF THE DEPARTMENT OF COMPUTER SCIENCE)

BY AKPORIDO OGHENETEGA This is to certify that this research work was carried out by AKPORIDO OGHENETEGA under the supervision of Mr. N.O. Ogini of the department of Mathematics and Computer Science, Delta State University, Abraka, during the 2010/2011 academic session.

_______________________ MR. N.O. OGINI (SUPERVISOR)

___________________ DR. A.O. ATONUJE (HEAD OF DEPARTMENT)

________________________ DATE

___________________ DATE

iv

DEDICATION I humbly dedicate this work to God almighty for the perfection and guidance to complete my first degree program successfully and also to my wonderful parents.

ACKNOWLEDGEMENT Firstly, my sincere thanks go to the Almighty God who in his infinite mercies has given me the opportunity which has enabled me to bag my Degree (B.Sc.) in Computer Science. My thanks also go to my project supervisor Mr. N.O. Ogini whose intellectual assistance during the course of writing this project is of immense importance. May God keep blessing you. My deep appreciation goes to my loving parents Chief and Chief (Mrs.) L.S.O. Akporido who made it possible for me to become a B.Sc. Degree holder after spending enormously without relenting, you are parents worthy of emulation. My own sincere gratitude goes to my beloved husband (Mr. Destiny T. Noritsegho), my son (Master Brian Noristsegho), my brothers and sisters for their support and my friends too numerous to mention. I say may God bless you all. Once again, I say thank you Jesus. Thank you my Lord for what I am now, it is by thy grace.

vi

ABSTRACT Utilizing this project software, academic advisers are able to monitor GPA, take appropriate action when necessary, guide their students, doing proper (especially for achieving the targeted GPA), able to simulate and set the realistic semester GPA target for their students based on GPA histories and capabilities. The system makes use of selected courses already stored in the database and students course grade and units which are fed into the system by course lecturer to calculate and produce the cumulative grade point average per student. The sole purpose of the research work is to aid lecturers in the department calculated students cumulative grade point average (CGPA) faster, more effectively without errors and with ease and also to help store the calculative grade point average of each student for easy access and retrieval for later use. In this research work we build a package that compute the Grade Point Average of students who sit for examinations in the Department of Computer Science in Delta State University using VB.NET and SQL server 2005.

vii

TABLE OF CONTENTS
Cover page - Title page - Certification Dedication - Abstract i ii iii iv v vi vii

Acknowledgement - Table of contents - CHAPTER ONE Introduction 1.1 1.2 1.3 1.4 1.5

Background of the study - Objective of the study Scope of study Methodology -

1 2 2 3 3

Limitations of the study - CHAPTER TWO LITERATURE REVIEW

2.1 2.2 2.3 2.4 2.5

Brief history of computing -

4 6 7 7 8

Manual versus computerised method Overview of the previous system -Overview of the present system - Process of result preparation -

viii

2.6 2.7

Mark sheet (manual computation system) GPA computation in algorithm format - -

10 10

CHAPTER THREE: SYSTEM ANALYSIS AND SYSTEM DESIGN

3.0

System analysis -

--

13 13 13 14 14 14 16 16 24 31 32 33

3.1 3.2 3.3


3.4

System investigation -

Analysis of the existing systemSystem design -

Benefits of the proposed system - -

3.4.1 Purpose 3.5

Database Specification -

3.5.1 Database Design - 3.6 3.7 3.8 3.9 Input Design Output Design -

Overall data flow diagram -

Choice of programming language CHAPTER FOUR

4.0 4.1

System implementation and documentation System requirements -

34 34 34

4.1.1 Hardware Requirements - -

ix

41.2 4.2 4.3 4.4 4.5

Software Requirements - Programming language in use System implementation Installation - -

35 35 36 36 36 37

4.3.1 System testing -

System maintenance CHAPTER FIVE

SUMMARY, RECOMMENDATION AND CONCLUSION 5.1 5.2 5.3 Summary -38 39 40 41 42 Recommendation - Conclusion - References - Appendix -

CHAPTER ONE INTRODUCTION 1.1 BACKGROUND OF THE STUDY

Grades are standardized measurements of varying levels of comprehension within a subject area. Grades are assigned in letters (for example: A, B, C, D, F, F), as a range (for example: 1.0-4.5), as a number out of 20, as descriptors (excellent, great, satisfactory), in percentages, or as is common in some higher institutions in some countries, as a Grade Point Average (GPA). GPA is calculated b taking the number of grade points a student earned in a given period of time divided by the total number of credits taken. The GPA can be used by potential employers or further post secondary institutions to assess and compare applicants. A cumulative Grade Point Average is a calculation of the average of all of a students grades for all semesters and course completed up to a given academic session, whereas the GPA ma only refer to one es1on. Up till no cumulative grade point average (CGPA) has been calculated by lecturers using manual methods and sometimes spreadsheet applications (e.g. calculators and Microsoft Excel respectively).

These manual methods are prone to errors, and efforts have been made by lecturers to solve problems emanating from using manual methods to compute GPA. Hence, this project work has been developed. 1.2 * OBJECTIVE OF THE STUDY To provide a platform for processing and storing computed GPA for all students. * To analyse the already stored data (computed GPA) in order to provide proper guidance * 1.3 To create a platform for computing GPA without errors. SCOPE OF STUDY

This project focuses on the computers to prepare Grade Point Average for students in only the department of computer science. It is designed to calculate CGPA for semester to semester, compute GPA at the end of the specific years the student spends in the school. It also covers the computing of the final grade in which the students are graduating with.

1.4

METHODOLOGY

The under listed methods were used to gather information/ data for this project work. Internet research with the aid of Wikipedia Personal interviews with some lecturers and students ill the department of computer science

Study of a previous work with similar bearing Study of other stand alone CGPA application codes in other to ascertain the correct formula for calculating CGPA.

In other to implement this system, macromedia fireworks were used to handle the graphics design, Microsoft visual studio 2008 with VB.NET programming language and SQL SERVER DATABASE for the database design. 1.5 LIMITATIONS OF THE STUDY This software is customized for only Mathematics & Computer Science departments in Delta State University. It cannot be used as a course registration tool.

Grades for each course have to be entered into the system instead of selected, which could be a little tiring for the user.

CHAPTER TWO LITERATURE REVIEW 2.1 BRIEF HISTORY OF COMPUTING

The history of computer started at about 2000 years ago, at the birth of Abacus a wooden rack holding two horizontal wires with beads string on them. When these beads are moved around according to programming rules memorized by the user, all regular arithmetic programs can be done. Another important invention around the lame time was Astrolabe, used for navigation. Blaise Pascal is usually credited for building the first digital computer in 1642. It added number entered with dials and was made to help his father, as tax collector. In 1671, Gottfried Wilhelm Von Leibniz invention a computer that was built in 1694. It could add and after changing some things around, multiply. Leibniz invented a special stepped gear mechanism for introducing the added digital and this is still in use. Thomas of Colmar created the first successful mechanical calculator that could add, subtract multiply and divide in 1890 with range of other desktop calculators by many inventors. In 1812 Babbage realized that many long calculations like mathematical tables were constantly repeated then he
5

designed different engine, and automatic mechanical calculating machine in 1822 till 1833 when a better idea came to a construct a better purpose; fully programmed controlled automatic digital computer called Analytical Engine between 1850 and 1900 great advances were made to improve on the previous that was slow in operation of speed. Until 1960 were major computer manufacturers began to offer a range of capabilities and prices, as well as accessories such as consoles, card feeders, page printers, cathode ray-tube displays, and Graphing devices. These were widely used in business such things as: (1) Accounting (2) Payroll (3) Inventory control (4) Ordering supplies (5) Billing.

More recently, invention of computer systems that could process manufacturing such as petroleum refining and electrical power distribution now use computers of small capability for controlling and regulating jobs.

The computer field continue to experience huge growth. Computer networking, computer mails and electronic publishing are just a few of the applications that have grown in recent years. Advances in technology continues to produce cheaper and more powerful computing offering the promise that in the near future computers terminals will reside in most, if not all homes, offices and schools. 2.2 MANUAL VERSUS COMPUTERISED METHOD

Before the mention of computers, manual method of calculation was in use. Manual method is the use of hand in general operations. This process has been found incorrect sometimes because of mathematically errors, this has been inefficient and time consuming. Computerized method is the use of the computer in carrying out duties. It is more efficient and effective in result. This is also faster unlike the manual method, it doesnt take too much time. It saves one of the error when in use; it does exactly what you want it to do. It also does more jobs it a time than the manual.

The invention of computer has actually made working much easier and less stressful. 2.3 OVERVIEW OF THE PREVIOUS SYSTEM

I discovered from my investigations and interviews that lecturers presently calculate grade point average (GPA) and cumulative grade point average (CGPA) manually with the aid of calculators. Others tend to automate their calculation with Microsoft Excel application. These methods and tools are prone to errors which could be injurious to both the lecturer and student involved. 2.4 OVERVIEW OF THE PRESENT SYSTEM

This present system customized for only mathematics and computer science department only with only mathematics and computer science units with all courses installed in the database for both first and second semester of all levels. There is a home screen that can be used to search for records that have been calculated and stored previously for all levels. The home screen also have group actions such as creating a user for a program and editing old user password.
8

The present system calculates Grand Point Average on the level basis (i.e semester by semester) and will finally produce a cumulative Grade Average having reached the final level for the respective student. The system also provides for the user a printable view of the entire courses calculated with the grades, credit unit, cumulating Grade Point and also comments showing the graduating result. 2.5 PROCESS OF RESULT PREPARATION

Here we make use of manual computation system. The department of mathematics and computer science still operates on the use of mark sheet in computing results for students.

DELTA STATE UNIVERSITY SESSIONAL EXAMINATION RESULTS RAW SCORE AND LETTER GRADING

Faculty of Science Level:_______________________ Dept of Mathematics and Computer Science Session:_____________________ Programme:_______________ By_________________
S/N Mat.No .
COURSE CODE NAME (surname first) Unit

Compiled
Remark

10

2.8

MARK SHEET (MANUAL COMPUTATION SYSTEM)

This is the system the department of computer science and others still operate. It is the use of mark sheet in computing GPA. Students scores for each courses are recoded in a mark sheet by the course lecturer and send to the course adviser of the level. It is used to compute the students GPA, prepare faculty and senate format and to update the undergraduate record sheet.

2.9 1.
2. 3.

GPA COMPUTATION IN ALGORITHM FORMAT Select course Enter Grade and credit unit Calculate Grade Point Average (G.P.A) using total level Grade Point/Total level course unit registered for.
4.

Calculate C.G.P.A using: level Grade Point/Total level course unit registered for.
11

The credit load varies in different courses while the Grade and Point remains the same.

Below are Grade and Points Grade A B C D E F Point 5 4 3 2 1 0

The final GPA is use to compute the class of degree for students. CLASS DEGREE First class Honour Second class Upper division Second class lower division Third class Pass 4.51-5.00 3.50-4.49 2.50-3.49 1.50-2.49 1.00-1.49
12

The mark sheet along with the GPA computation listed above is use to fill the GPA computational sheet. The final GPA only appears on the sheet for the last year of study. And for different level there are GPA computation sheet. All these sheets for each level are kept as the student academic record. Each faculty may give overall evaluation not exceeding 0.1 grade point to be added to the final GP. This occurs when the faculty boards decide to upgrade a student GPA for a genuine reason. If change is made it is reflected in another column of the form otherwise its value remains the same.

This is an example of a computation sheet:

13

DELTA STATE UNIVERSITY, ABRAKA DEPARTMENT OF MATHEMATICS & COMPUTER SCIENCE Venue:.. Dept:..Course:.. Date:... S/N Mat. Name Booklet Level Sign Exam CA Total Grades Remark No. (Surname No. first)

Examiners Signature:..

Date:

14

CHAPTER THREE SYSTEM ANALYSIS AND SYSTEM DESIGN 3.0 SYSTEM ANALYSIS

Systems analysis is the study of sets of interacting entities, including computer systems analysis. It is also "an explicit formal inquiry carried out to help someone (referred to as the decision maker) identify a better course of action and make a better decision than he might otherwise have made." 3.1 SYSTEM INVESTIGATION

Lecturers in the department of mathematics and computer science were interviewed on how grade point average (GPA) and cumulative grade point average (CGPA) are calculated, what methods and tools they used in calculation. 3.2 ANALYSIS OF THE EXISTING SYSTEM

I discovered from my investigations and interviews that lecturers presently calculate grade point average (GPA) and cumulative grade point average (CGPA) manually with the aid of calculators. Others tend to automate their calculation with Microsoft Excel application.

15

These methods and tools are prone to errors which could be injurious to both the lecturer and student involved. 3.3 BENEFITS OF THE PROPOSED SYSTEM The following are the Benefits of the proposed system; Efficient and reliable system to manage student information The system will reduce errors in computing students (GPA) and (CGPA) The system is capable of storing every calculated CGPA to be for reference at a later time, thus reducing the difficulties in searching for student information

The system provides automated calculation of GPA and CGPA for the lecturers

3.4 SYSTEM DESIGN 3.4.1 Purpose

16

The purpose of System Design is to create a technical solution that satisfies the functional requirements for the system. At this point in the project lifecycle there should be a Functional Specification, written primarily in business terminology, containing a complete description of the operational needs of the various organizational entities that will use the new system. The challenge is to translate all of this information into Technical Specifications that accurately describe the design of the system, and that can be used as input to System Construction. The Functional Specification produced during System Requirements Analysis is transformed into a physical architecture. System components are distributed across the physical architecture, usable interfaces are designed and prototyped, and Technical Specifications are created for the Application Developers, enabling them to build and test the system. Many organizations look at System Design primarily as the preparation of the system component specifications; however, constructing the various system components is only one of a set of major steps in successfully building a system. The preparation of the environment needed to build the system, the

17

testing of the system, and the migration and preparation of the data that will ultimately be used by the system are equally important. In addition to designing the technical solution, System Design is the time to initiate focused planning efforts for both the testing and data preparation activities. 3.5 DATABASE SPECIFICATION

Microsoft SQL server 2005 enterprise edition database was used for this project. The database was used to create the following tables: AdminLogin, OneHundred, StudDetails, HundredSecond, TwoHundredFirst, ThreeHundredSecond,

TwoHundredSecond,

ThreeHundredFirst,

FourHundredFirst, FourHundredSecond. The databases were fully accessed using ADO.Net connection. The ADO.net provides an API for accessing database system programmatically. SQL statements were used in querying and updating records. 3.5.1 DATABASE DESIGN The term database design can be used to describe many different parts of the design of an overall database system. Principally, and most correctly, it can be thought of as the logical design of the base data structures used to store the

18

data. In the relational model these are the tables and views. In an object database the entities and relationships map directly to object classes and named relationships. However, the term database design could also be used to apply to the overall process of designing, not just the base data structures, but also the forms and queries used as part of the overall database application within the database management system (DBMS). The process of doing database design generally consists of a number of steps which will be carried out by the database designer. Usually, the designer must:

Determine the relationships between the different data elements. Superimpose a logical structure upon the data on the basis of these relationships. Some of the Database Table Structure used in this project is shown below.

19

Admin Login

Fig. 1.0

20

Students Records

Fig. 1.1

21

Hundred Level First Semester

Fig. 1.2

22

Hundred Level Second Semester

Fig. 1.3

23

Two Hundred Level First Semester

Fig. 1.4

24

Two hundred Level Second Semester

Fig. 1.5

25

3.6

INPUT DESIGN

The input design specifies how data are entered and accepted by the system for processing. The design specifies how the user interacts with the system to direct the action to be taken. The types of input controls used are Textboxes Combo Box List Views Menus Some of the input forms are shown below

26

Login Form:

Fig. 1.6

27

Home Form:

Fig. 1.7

28

Hundred Level GPA Form

Fig. 1.8

29

Two Hundred Level Form

Fig. 1.9

30

Three Hundred Level Form

Fig. 2.0

31

Four Hundred Level Form:

Fig. 2.1
32

3.7

OUTPUT DESIGN

This refers to the results that are generated by the system. The output of the design is through the use of labels and data grid views that are populated from the processed data in the database.

33

Fig. 2.2

3.8 OVERAL DATA FLOW DIAGRAM

ADMIN USER

LOGIN

DATA BASE

SEARCH RECORD

HOME SCREEN EDIT PASS WORK

NEW USER
DATA BASE

CALCULA TE GPA

100 LEVEL

200 LEVEL

34 300 LEVEL

400 LEVEL

500 LEVEL

Fig. 1.13

3.9

CHOICE OF PROGRAMMING LANGUAGE

Microsoft visual web developer was used as the web authoring tool because of its flexibility, bend ability and very easy deploying site. Microsoft SQL server 2005 enterprise edition was used for designing the database that served as the backend for storing information because of its high maintenance and security tool. Visual Basic.NET language was used for implementation.

35

CHAPTER FOUR 4.0 SYSTEM IMPLEMENTATION AND DOCUMENTATION

According to Ekanem (2005) system implementation has to do with the coordination of the system components in order to make its not just workable but highly successful. It consists of the following task, system conversion, final document compilation and user training. 4.1 SYSTEM REQUIREMENTS

4.1.1 Hardware Requirements For the system to be fully operational, full multimedia internet converted computer system with a minimum of the following requirements is needed. 1. 2. 3. 4. 5. 6. 7. Pentium H, Pentium Ill or Pentium iv or M processor or an equivalent A minimum of 10 GB hard disk space A minimum of 64 of RAM A super VGA (Video Graphic Array) color monitor A Ps/2 serial or USB mouse and a PS/2 serial or USB keyboard A DeskJet or LaserJet Printer UPS (uninterrupted power supply).

36

41.2 * * *

Software Requirements Microsoft SQL server 2005 express edition for storage of input data. Microsoft.net frame work 2.0 and above. Microsoft internet information services (1156.0)

Software Protection: Anti Virus: This is used to avoid virus attacking the software.. 4.2 PROGRAMMING LANGUAGE IN USE

The programming language used is Visual Basic, the reason for the choice of visual basic is because it is a general programming language. This means that visual basic can be used to device virtually any time of application software from scientific to engineering to business oriented. Visual basic.net is an object oriented programming language, structured programming language and a system that obey all the principles of production program styles, its features include; a. b. c. d. Portability Re-usability Easy writing of codes User friendly
37

Other features of visual basic include the ability to integrate with other application like Microsoft SQL SERVER EXPRESS EDITION. 4.3 SYSTEM IMPLEMENTATION

The system implementation includes all the activities that are carried out in order to put the theoretical design into a functional or practical state. All activities like programming, software installation and hardware installation are coordinated to put the new system in operation. 4.3.1 System testing: The packages help the side engineers or rather give him good headway and also even when he is not on sit, someone can operate the computer and determine which way to take. Also records that have been stored can also called up and use as reference point. 4.4 INSTALLATION Insert the CD ROM containing the executable file. Double click on the executable file to start the installation Select I Agree to accept the terms of use.

38

Select create desktop shortcut to create a program shortcut. Click Finish to end the installation 4.5 SYSTEM MAINTENANCE As responsibility grows and demands are made pages will be added or modified by developers.

39

CHAPTER FIVE SUMMARY, RECOMMENDATION AND CONCLUSION 5.1 SUMMARY

This project is aimed at computing the result of Students in the department of Computer Science. This study is to make compilation process 1sier than it is presently. Computer is an electrical device which stores information and retrieve them faster. Comparing manual with the, new system, we discovered that, the computer will do job more and will also lighten the bulk of work on course advisers. The propose system will go a long relieving such avoidable stress. The drawbacks or constraints of the present system can be handled if the new system is welcomed. The implementation of the new system involves round two requirements, the hardware and the software.

40

5.2

RECOMMEDATION

The problem of manual computation can be lightened via the use the propose system. The following steps should be worked upon for improvement; 1. Staff especially course advisers should be prepared for a change of system. 2. Adequate installations of computer systems for course advisers even all staff. 3. Course advisers should be able to query the computer for necessary in format ion that will be of help. 4. 5. Learning of new programs should be encouraged Seminars and workshops should organize from time to time to expand their ozone. 6. Students must ensure that, they register their courses on time, because it can cause delay in preparing GPA in the new system. These and others should be embraced for improvement.

41

5.3

CONCLUSION

It has been proven over the time that, manual calculation is prone to error very unlike the computer. The purpose of this project is to compute the GPA for department of Computer Science students result with a software program. This can also compute for any other department of four years degree programme. This program is designed to enable course advisers perform their duties with less stress and more efficient result. This approach will make computation easy, faster, and timely than the manual method. In all, this project is subject to purified corrections, and suggestions a better improvement.

42

REFERENCES Chiemeke S. C. (2005), System Design and Analysis, Lecture Note, Unpublished. Copeland B. Jack (2001), History of Computing, available at <http: //www.copeland.com>. Davis E. A. (2000), Database Management, Dell Press, U.S.A. Evangelous P. (2002), Mastering Visual Basic 6.0, second edition, BPB Publications, New Delhi. Faculty of science prospectus (2002/2003), University of Benin, Benin City. Meyers, Jeremy (2005), History of computer available at {http ://www .softlord.com/comp}. Noel A. R. (2003), System Analysis for Beginners, third edition, NAR Publications, Netherlands. Onibere E. A. (2005), Software Engineering: Lecture Note, Unpublished. Patrick X. F. (2000), Introduction to Database Using Access, conceptual Foundation, Englewood Cliff, Prentice Hall. Richard A. B. (2001), Computerized and Manual Method, available at {http://www.ascaras.com}. http://en.wikipedia.org/wiki/Systems_analysis http://www.cio.ny.gov/pmmp/guidebook2/SystemDesign.pdf.

43

APPENDIX A (SOURCE CODES) Login Form Code Imports System.Data.SqlClient Public Class Form1 Dim dbs As New dbops Public username As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click dbs.connect() Dim cmd As New SqlCommand cmd.Connection = dbs.cn cmd.CommandText = "SELECT * FROM AdminLogin WHERE Username ='" & TextBox1.Text & "'" Dim rd As SqlDataReader rd = cmd.ExecuteReader If rd.HasRows = True Then rd.Read() If TextBox2.Text = rd.Item("password") Then Me.Hide() home.Show() Exit Sub ElseIf TextBox2.Text <> rd.Item("password") Then MsgBox("Invalid Password", MsgBoxStyle.Exclamation) End If ElseIf rd.HasRows = False Then MsgBox("Invalid Username", MsgBoxStyle.Exclamation) End If dbs.cn.Close()
44

Me.Close() End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim bb As New dbops bb.ConnectDatabase() If bb.cSettings = True Then Exit Sub Else Me.Hide() ServerSettings.Show() End If End Sub End Class Home Form Code Imports System.Data.SqlClient Public Class home Dim dbs As New dbops Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click logged.Show() End Sub Private Sub home_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub

45

Private Sub txtSurname_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSurname.TextChanged On Error Resume Next Dim bb As New dbops bb.CalculatedGpaByName(DataGridView1, txtSurname.Text) End Sub Private Sub txtMatric_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMatric.TextChanged On Error Resume Next Dim bb As New dbops bb.CalculatedGpaByMatricNo(DataGridView1, txtMatric.Text) End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click conmsg = MsgBox("Do you want to close the program", MsgBoxStyle.YesNo, "Exit Program") If conmsg = 6 Then Application.Exit() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click GroupBox1.Enabled = True GroupBox2.Enabled = False GroupBox3.Enabled = False End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click GroupBox1.Enabled = False GroupBox2.Enabled = True GroupBox3.Enabled = False End Sub
46

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click GroupBox1.Enabled = False GroupBox2.Enabled = False GroupBox3.Enabled = True End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click dbs.connect() Dim cmd As New SqlCommand cmd.Connection = dbs.cn cmd.CommandText = "INSERT INTO AdminLogin VALUES ('" & txtUname.Text & "','" & txtUpass.Text & "','" & txtRole.Text & "')" cmd.ExecuteNonQuery() dbs.cn.Close() MsgBox("User created successfully!", MsgBoxStyle.OkOnly, "New User Created") txtUname.Text = "" txtUpass.Text = "" txtRole.Text = "" GroupBox2.Enabled = False End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click dbs.connect() Dim cmd As New SqlCommand cmd.Connection = dbs.cn cmd.CommandText = "SELECT * FROM AdminLogin WHERE username ='" & txtEuser.Text & "'"
47

Dim rd As SqlDataReader rd = cmd.ExecuteReader If rd.HasRows = True Then rd.Read() If rd.Item("password") = txtOpass.Text Then rd.Close() cmd.CommandText = "UPDATE AdminLogin SET password='" & txtNpass.Text & "' where Username='" & txtEuser.Text & "'" cmd.ExecuteNonQuery() dbs.cn.Close() txtEuser.Text = "" txtNpass.Text = "" txtOpass.Text = "" GroupBox3.Enabled = False Else rd.Close() MsgBox("The old password you entered is wrong!", MsgBoxStyle.RetryCancel, "Wrong Password") dbs.cn.Close() End If ElseIf rd.HasRows = False Then MsgBox("Username not found!", MsgBoxStyle.RetryCancel, "Wrong Password") End If End Sub End Class GPA Calculation Code Imports System.Data.SqlClient Public Class _300level
48

Dim dbs As New dbops Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click conmsg = MsgBox("Please save the students data" & vbCrLf & "Go to next level", MsgBoxStyle.YesNo) If conmsg = 6 Then Me.Hide() _400level.Show() End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() _200Level.Show() End Sub Private Sub _300level_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load txtSurname.Text = SessionSurname txtOthername.Text = SessionOthername txtMatric.Text = SessionMatric txtSession.Text = SessionSession txtGPA.Text = FormatNumber(levelcgpa, 2) Dim bb As New dbops bb.GetThreeHundredLevelFirstSemesterCourses(cCode1) bb.GetThreeHundredLevelFirstSemesterCourses(cCode2) bb.GetThreeHundredLevelFirstSemesterCourses(cCode3) bb.GetThreeHundredLevelFirstSemesterCourses(cCode4) bb.GetThreeHundredLevelFirstSemesterCourses(cCode5) bb.GetThreeHundredLevelFirstSemesterCourses(cCode6) bb.GetThreeHundredLevelFirstSemesterCourses(cCode7) bb.GetTwoHundredLevelFirstSemesterCourses(cCode8)
49

bb.GetThreeHundredLevelFirstSemesterCourses(cCode9) bb.GetThreeHundredLevelFirstSemesterCourses(cCode10) bb.GetThreeHundredLevelSecondSemesterCourses(cCode11) bb.GetThreeHundredLevelSecondSemesterCourses(cCode12) bb.GetThreeHundredLevelSecondSemesterCourses(cCode13) bb.GetThreeHundredLevelSecondSemesterCourses(cCode14) bb.GetThreeHundredLevelSecondSemesterCourses(cCode15) bb.GetThreeHundredLevelSecondSemesterCourses(cCode16) bb.GetThreeHundredLevelSecondSemesterCourses(cCode17) bb.GetThreeHundredLevelSecondSemesterCourses(cCode18) bb.GetThreeHundredLevelSecondSemesterCourses(cCode19) bb.GetThreeHundredLevelSecondSemesterCourses(cCode20) End Sub Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click conmsg = MsgBox("Do you want to close the program", MsgBoxStyle.YesNo, "Exit Program") If conmsg = 6 Then Me.Close() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim gpa1 As Double Dim TotalUnit As Double = 0 If txtGrade1.Text = "A" Or txtGrade1.Text = "a" Then score = 5 ElseIf txtGrade1.Text = "B" Or txtGrade1.Text = "b" Then score = 4 ElseIf txtGrade1.Text = "C" Or txtGrade1.Text = "c" Then score = 3
50

ElseIf txtGrade1.Text = "D" Or txtGrade1.Text = "d" Then score = 2 ElseIf txtGrade1.Text = "E" Or txtGrade1.Text = "e" Then score = 1 ElseIf txtGrade1.Text = "F" Or txtGrade1.Text = "f" Then score = 0 End If TotalUnit = TotalUnit + Val(CourseUnit1.Text) 'increase total unit gpa1 = score * Val(CourseUnit1.Text) '1st course gpa 'Start calculating for second course If txtGrade2.Text = "A" Or txtGrade2.Text = "a" Then score = 5 ElseIf txtGrade2.Text = "B" Or txtGrade2.Text = "b" Then score = 4 ElseIf txtGrade2.Text = "C" Or txtGrade2.Text = "c" Then score = 3 ElseIf txtGrade2.Text = "D" Or txtGrade2.Text = "d" Then score = 2 ElseIf txtGrade2.Text = "E" Or txtGrade2.Text = "e" Then score = 1 ElseIf txtGrade2.Text = "F" Or txtGrade2.Text = "f" Then score = 0 End If Dim gpa2 As Double 'variable to hold 2nd course gpa TotalUnit = TotalUnit + Val(CourseUnit2.Text) 'increase total unit gpa2 = score * Val(CourseUnit2.Text) '2nd course gpa 'Start calculating for third course If txtGrade3.Text = "A" Or txtGrade3.Text = "a" Then score = 5 ElseIf txtGrade3.Text = "B" Or txtGrade3.Text = "b" Then score = 4 ElseIf txtGrade3.Text = "C" Or txtGrade3.Text = "c" Then score = 3
51

ElseIf txtGrade3.Text = "D" Or txtGrade3.Text = "d" Then score = 2 ElseIf txtGrade3.Text = "E" Or txtGrade3.Text = "e" Then score = 1 ElseIf txtGrade3.Text = "F" Or txtGrade3.Text = "f" Then score = 0 End If Dim gpa3 As Double 'variable to hold 3rd course gpa TotalUnit = TotalUnit + Val(CourseUnit3.Text) 'increase total unit gpa3 = score * Val(CourseUnit3.Text) '3rd course gpa 'Start calculating for fourth course If txtGrade4.Text = "A" Or txtGrade4.Text = "a" Then score = 5 ElseIf txtGrade4.Text = "B" Or txtGrade4.Text = "b" Then score = 4 ElseIf txtGrade4.Text = "C" Or txtGrade4.Text = "c" Then score = 3 ElseIf txtGrade4.Text = "D" Or txtGrade4.Text = "d" Then score = 2 ElseIf txtGrade4.Text = "E" Or txtGrade4.Text = "e" Then score = 1 ElseIf txtGrade4.Text = "F" Or txtGrade4.Text = "f" Then score = 0 End If Dim gpa4 As Double 'variable to hold 4th course gpa TotalUnit = TotalUnit + Val(CourseUnit4.Text) 'increase total unit gpa4 = score * Val(CourseUnit4.Text) '4th course gpa 'Start calculating for fifth course If txtGrade5.Text = "A" Or txtGrade5.Text = "a" Then score = 5 ElseIf txtGrade5.Text = "B" Or txtGrade5.Text = "b" Then score = 4 ElseIf txtGrade5.Text = "C" Or txtGrade5.Text = "c" Then score = 3
52

ElseIf txtGrade5.Text = "D" Or txtGrade5.Text = "d" Then score = 2 ElseIf txtGrade5.Text = "E" Or txtGrade5.Text = "e" Then score = 1 ElseIf txtGrade5.Text = "F" Or txtGrade5.Text = "f" Then score = 0 End If Dim gpa5 As Double 'variable to hold 4th course gpa TotalUnit = TotalUnit + Val(CourseUnit5.Text) 'increase total unit gpa5 = score * Val(CourseUnit5.Text) '5th course gpa 'Start calculating for fifth course If txtGrade6.Text = "A" Or txtGrade6.Text = "a" Then score = 5 ElseIf txtGrade6.Text = "B" Or txtGrade6.Text = "b" Then score = 4 ElseIf txtGrade6.Text = "C" Or txtGrade6.Text = "c" Then score = 3 ElseIf txtGrade6.Text = "D" Or txtGrade6.Text = "d" Then score = 2 ElseIf txtGrade6.Text = "E" Or txtGrade6.Text = "e" Then score = 1 ElseIf txtGrade6.Text = "F" Or txtGrade6.Text = "f" Then score = 0 End If Dim gpa6 As Double 'variable to hold 4th course gpa TotalUnit = TotalUnit + Val(CourseUnit6.Text) 'increase total unit gpa6 = score * Val(CourseUnit6.Text) '6th course gpa 'Start calculating for 7th course If txtGrade7.Text = "A" Or txtGrade7.Text = "a" Then score = 5 ElseIf txtGrade7.Text = "B" Or txtGrade7.Text = "b" Then score = 4 ElseIf txtGrade7.Text = "C" Or txtGrade7.Text = "c" Then score = 3
53

ElseIf txtGrade7.Text = "D" Or txtGrade7.Text = "d" Then score = 2 ElseIf txtGrade7.Text = "E" Or txtGrade7.Text = "e" Then score = 1 ElseIf txtGrade7.Text = "F" Or txtGrade7.Text = "f" Then score = 0 End If Dim gpa7 As Double 'variable to hold 7th course gpa TotalUnit = TotalUnit + Val(CourseUnit7.Text) 'increase total unit gpa7 = score * Val(CourseUnit7.Text) '7th course gpa 'Start calculating for fifth course If txtGrade8.Text = "A" Or txtGrade8.Text = "a" Then score = 5 ElseIf txtGrade8.Text = "B" Or txtGrade8.Text = "b" Then score = 4 ElseIf txtGrade8.Text = "C" Or txtGrade8.Text = "c" Then score = 3 ElseIf txtGrade8.Text = "D" Or txtGrade8.Text = "d" Then score = 2 ElseIf txtGrade8.Text = "E" Or txtGrade8.Text = "e" Then score = 1 ElseIf txtGrade8.Text = "F" Or txtGrade8.Text = "f" Then score = 0 End If Dim gpa8 As Double 'variable to hold 8th course gpa TotalUnit = TotalUnit + Val(CourseUnit8.Text) 'increase total unit gpa8 = score * Val(CourseUnit8.Text) '8th course gpa 'Start calculating for 9th course If txtGrade9.Text = "A" Or txtGrade9.Text = "a" Then score = 5 ElseIf txtGrade9.Text = "B" Or txtGrade9.Text = "b" Then score = 4 ElseIf txtGrade9.Text = "C" Or txtGrade9.Text = "c" Then score = 3
54

ElseIf txtGrade9.Text = "D" Or txtGrade9.Text = "d" Then score = 2 ElseIf txtGrade9.Text = "E" Or txtGrade9.Text = "e" Then score = 1 ElseIf txtGrade9.Text = "F" Or txtGrade9.Text = "f" Then score = 0 End If Dim gpa9 As Double 'variable to hold 9th course gpa TotalUnit = TotalUnit + Val(CourseUnit9.Text) 'increase total unit gpa9 = score * Val(CourseUnit9.Text) '9th course gpa 'Start calculating for fifth course If txtGrade10.Text = "A" Or txtGrade10.Text = "a" Then score = 5 ElseIf txtGrade10.Text = "B" Or txtGrade10.Text = "b" Then score = 4 ElseIf txtGrade10.Text = "C" Or txtGrade10.Text = "c" Then score = 3 ElseIf txtGrade10.Text = "D" Or txtGrade10.Text = "d" Then score = 2 ElseIf txtGrade10.Text = "E" Or txtGrade10.Text = "e" Then score = 1 ElseIf txtGrade10.Text = "F" Or txtGrade10.Text = "f" Then score = 0 End If Dim gpa10 As Double 'variable to hold 10th course gpa TotalUnit = TotalUnit + Val(CourseUnit10.Text) 'increase total unit gpa10 = score * Val(CourseUnit10.Text) '10th course gpa 'start calculating 11th course gpa If txtGrade11.Text = "A" Or txtGrade11.Text = "a" Then score = 5 ElseIf txtGrade11.Text = "B" Or txtGrade11.Text = "b" Then score = 4 ElseIf txtGrade11.Text = "C" Or txtGrade11.Text = "c" Then score = 3
55

ElseIf txtGrade11.Text = "D" Or txtGrade11.Text = "d" Then score = 2 ElseIf txtGrade1.Text = "E" Or txtGrade11.Text = "e" Then score = 1 ElseIf txtGrade11.Text = "F" Or txtGrade11.Text = "f" Then score = 0 End If Dim gpa11 As Double TotalUnit = TotalUnit + Val(CourseUnit11.Text) 'increase total unit gpa11 = score * Val(CourseUnit11.Text) '11th course gpa 'Start calculating for 12th course If txtGrade12.Text = "A" Or txtGrade12.Text = "a" Then score = 5 ElseIf txtGrade12.Text = "B" Or txtGrade12.Text = "b" Then score = 4 ElseIf txtGrade12.Text = "C" Or txtGrade12.Text = "c" Then score = 3 ElseIf txtGrade12.Text = "D" Or txtGrade12.Text = "d" Then score = 2 ElseIf txtGrade12.Text = "E" Or txtGrade12.Text = "e" Then score = 1 ElseIf txtGrade12.Text = "F" Or txtGrade12.Text = "f" Then score = 0 End If Dim gpa12 As Double 'variable to hold 12th course gpa TotalUnit = TotalUnit + Val(CourseUnit12.Text) 'increase total unit gpa12 = score * Val(CourseUnit12.Text) '12th course gpa 'Start calculating for 13th course If txtGrade13.Text = "A" Or txtGrade13.Text = "a" Then score = 5 ElseIf txtGrade13.Text = "B" Or txtGrade13.Text = "b" Then score = 4 ElseIf txtGrade13.Text = "C" Or txtGrade13.Text = "c" Then
56

score = 3 ElseIf txtGrade13.Text = "D" Or txtGrade13.Text = "d" Then score = 2 ElseIf txtGrade13.Text = "E" Or txtGrade13.Text = "e" Then score = 1 ElseIf txtGrade13.Text = "F" Or txtGrade13.Text = "f" Then score = 0 End If Dim gpa13 As Double 'variable to hold 13th course gpa TotalUnit = TotalUnit + Val(CourseUnit13.Text) 'increase total unit gpa13 = score * Val(CourseUnit13.Text) '13th course gpa 'Start calculating for 14th course If txtGrade14.Text = "A" Or txtGrade14.Text = "a" Then score = 5 ElseIf txtGrade14.Text = "B" Or txtGrade14.Text = "b" Then score = 4 ElseIf txtGrade14.Text = "C" Or txtGrade14.Text = "c" Then score = 3 ElseIf txtGrade14.Text = "D" Or txtGrade14.Text = "d" Then score = 2 ElseIf txtGrade14.Text = "E" Or txtGrade14.Text = "e" Then score = 1 ElseIf txtGrade14.Text = "F" Or txtGrade14.Text = "f" Then score = 0 End If Dim gpa14 As Double 'variable to hold 14th course gpa TotalUnit = TotalUnit + Val(CourseUnit14.Text) 'increase total unit gpa14 = score * Val(CourseUnit14.Text) '14th course gpa 'Start calculating for 15th course If txtGrade15.Text = "A" Or txtGrade15.Text = "a" Then score = 5 ElseIf txtGrade15.Text = "B" Or txtGrade15.Text = "b" Then score = 4 ElseIf txtGrade15.Text = "C" Or txtGrade15.Text = "c" Then
57

score = 3 ElseIf txtGrade15.Text = "D" Or txtGrade15.Text = "d" Then score = 2 ElseIf txtGrade15.Text = "E" Or txtGrade15.Text = "e" Then score = 1 ElseIf txtGrade15.Text = "F" Or txtGrade15.Text = "f" Then score = 0 End If Dim gpa15 As Double 'variable to hold 15th course gpa TotalUnit = TotalUnit + Val(CourseUnit15.Text) 'increase total unit gpa15 = score * Val(CourseUnit15.Text) '15th course gpa 'Start calculating for 16th course If txtGrade16.Text = "A" Or txtGrade16.Text = "a" Then score = 5 ElseIf txtGrade16.Text = "B" Or txtGrade16.Text = "b" Then score = 4 ElseIf txtGrade16.Text = "C" Or txtGrade16.Text = "c" Then score = 3 ElseIf txtGrade16.Text = "D" Or txtGrade16.Text = "d" Then score = 2 ElseIf txtGrade16.Text = "E" Or txtGrade16.Text = "e" Then score = 1 ElseIf txtGrade16.Text = "F" Or txtGrade16.Text = "f" Then score = 0 End If Dim gpa16 As Double 'variable to hold 16th course gpa TotalUnit = TotalUnit + Val(CourseUnit16.Text) 'increase total unit gpa16 = score * Val(CourseUnit16.Text) '16th course gpa 'Start calculating for 17th course If txtGrade17.Text = "A" Or txtGrade17.Text = "a" Then score = 5 ElseIf txtGrade17.Text = "B" Or txtGrade17.Text = "b" Then score = 4 ElseIf txtGrade17.Text = "C" Or txtGrade17.Text = "c" Then
58

score = 3 ElseIf txtGrade17.Text = "D" Or txtGrade17.Text = "d" Then score = 2 ElseIf txtGrade17.Text = "E" Or txtGrade17.Text = "e" Then score = 1 ElseIf txtGrade17.Text = "F" Or txtGrade17.Text = "f" Then score = 0 End If Dim gpa17 As Double 'variable to hold 17th course gpa TotalUnit = TotalUnit + Val(CourseUnit17.Text) 'increase total unit gpa17 = score * Val(CourseUnit17.Text) '17th course gpa 'Start calculating for 18th course If txtGrade18.Text = "A" Or txtGrade18.Text = "a" Then score = 5 ElseIf txtGrade18.Text = "B" Or txtGrade18.Text = "b" Then score = 4 ElseIf txtGrade18.Text = "C" Or txtGrade18.Text = "c" Then score = 3 ElseIf txtGrade18.Text = "D" Or txtGrade18.Text = "d" Then score = 2 ElseIf txtGrade18.Text = "E" Or txtGrade18.Text = "e" Then score = 1 ElseIf txtGrade18.Text = "F" Or txtGrade18.Text = "f" Then score = 0 End If Dim gpa18 As Double 'variable to hold 18th course gpa TotalUnit = TotalUnit + Val(CourseUnit18.Text) 'increase total unit gpa18 = score * Val(CourseUnit18.Text) '18th course gpa 'Start calculating for 19th course If txtGrade19.Text = "A" Or txtGrade19.Text = "a" Then score = 5 ElseIf txtGrade19.Text = "B" Or txtGrade19.Text = "b" Then score = 4 ElseIf txtGrade19.Text = "C" Or txtGrade19.Text = "c" Then
59

score = 3 ElseIf txtGrade19.Text = "D" Or txtGrade19.Text = "d" Then score = 2 ElseIf txtGrade19.Text = "E" Or txtGrade19.Text = "e" Then score = 1 ElseIf txtGrade19.Text = "F" Or txtGrade19.Text = "f" Then score = 0 End If Dim gpa19 As Double 'variable to hold 19th course gpa TotalUnit = TotalUnit + Val(CourseUnit19.Text) 'increase total unit gpa19 = score * Val(CourseUnit19.Text) '19th course gpa 'Start calculating for fifth course If txtGrade20.Text = "A" Or txtGrade20.Text = "a" Then score = 5 ElseIf txtGrade20.Text = "B" Or txtGrade20.Text = "b" Then score = 4 ElseIf txtGrade20.Text = "C" Or txtGrade20.Text = "c" Then score = 3 ElseIf txtGrade20.Text = "D" Or txtGrade20.Text = "d" Then score = 2 ElseIf txtGrade20.Text = "E" Or txtGrade20.Text = "e" Then score = 1 ElseIf txtGrade20.Text = "F" Or txtGrade20.Text = "f" Then score = 0 End If Dim gpa20 As Double 'variable to hold 20th course gpa TotalUnit = TotalUnit + Val(CourseUnit20.Text) 'increase total unit gpa20 = score * Val(CourseUnit20.Text) '20th course gpa 'Start Calculating total gpa FifthSemester = gpa1 + gpa2 + gpa3 + gpa4 + gpa5 + gpa6 + gpa7 + gpa8 + gpa9 + gpa10 'Calculate total first semester gpa 'FirstSemester = FirstSemester / TotalUnit 'divide total gpa by total unit

60

SixthSemester = gpa11 + gpa12 + gpa13 + gpa14 + gpa15 + gpa16 + gpa17 + gpa18 + gpa19 + gpa20 overallunit = overallunit + TotalUnit levelcgpa = FirstSemester + SecondSemester + ThirdSemester + FourthSemester levelcgpa = levelcgpa + FifthSemester + SixthSemester levelcgpa = levelcgpa / overallunit 'levelCgpa = levelCgpa / 2 txtGPA.Text = FormatNumber(levelcgpa, 2) Button2.Enabled = False End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim cLevel As Integer = 300 dbs.connect() Dim cmd As New SqlCommand cmd.Connection = dbs.cn cmd.CommandText = "INSERT INTO StudDetails values ('" & txtMatric.Text & "','" & txtSurname.Text & "','" & _ txtOthername.Text & "','" & txtSession.Text & "','" & cLevel & "','" & cCode1.Text & "','" & cCode2.Text & "','" & _ cCode3.Text & "','" & cCode4.Text & "','" & cCode5.Text & "','" & cCode6.Text & "','" & cCode7.Text & "','" & _ cCode8.Text & "','" & cCode9.Text & "','" & cCode10.Text & "','" & cCode11.Text & "','" & cCode12.Text & "','" & _ cCode13.Text & "','" & cCode14.Text & "','" & cCode15.Text & "','" & cCode16.Text & "','" & cCode17.Text & "','" & _ cCode18.Text & "','" & cCode19.Text & "','" & cCode20.Text & "','" & overallunit & "','" & txtGPA.Text & "')" cmd.ExecuteNonQuery() dbs.cn.Close() dbs.connect()
61

cmd.CommandText = "INSERT INTO FirstSemester VALUES ('" & txtMatric.Text & "','" & txtSurname.Text & "','" & _ txtOthername.Text & "','" & txtSession.Text & "','" & cLevel & "','" & txtGrade1.Text & "','" & txtGrade2.Text & "','" & _ txtGrade3.Text & "','" & txtGrade4.Text & "','" & txtGrade5.Text & "','" & txtGrade6.Text & "','" & txtGrade7.Text & "','" & _ txtGrade8.Text & "','" & txtGrade9.Text & "','" & txtGrade10.Text & "','" & txtGrade11.Text & "','" & txtGrade12.Text & "','" & _ txtGrade13.Text & "','" & txtGrade14.Text & "','" & txtGrade15.Text & "','" & txtGrade16.Text & "','" & txtGrade17.Text & "','" & _ txtGrade18.Text & "','" & txtGrade19.Text & "','" & txtGrade20.Text & "')" cmd.ExecuteNonQuery() dbs.cn.Close() MsgBox("300 Level Result Saved Successfully", MsgBoxStyle.OkOnly, "Result Saved") Button4.Enabled = False End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Button2.Enabled = True cCode1.Text = "" cCode2.Text = "" cCode3.Text = "" cCode4.Text = "" cCode5.Text = "" cCode6.Text = "" cCode7.Text = "" cCode8.Text = "" cCode9.Text = "" cCode10.Text = "" cCode11.Text = "" cCode12.Text = "" cCode13.Text = "" cCode14.Text = ""
62

cCode15.Text = "" cCode16.Text = "" cCode17.Text = "" cCode18.Text = "" cCode19.Text = "" cCode20.Text = "" txtGrade1.Text = "" txtGrade2.Text = "" txtGrade3.Text = "" txtGrade4.Text = "" txtGrade5.Text = "" txtGrade6.Text = "" txtGrade7.Text = "" txtGrade8.Text = "" txtGrade9.Text = "" txtGrade10.Text = "" txtGrade11.Text = "" txtGrade12.Text = "" txtGrade13.Text = "" txtGrade14.Text = "" txtGrade15.Text = "" txtGrade16.Text = "" txtGrade17.Text = "" txtGrade18.Text = "" txtGrade19.Text = "" txtGrade20.Text = "" CourseUnit1.Text = "" CourseUnit2.Text = "" CourseUnit3.Text = "" CourseUnit4.Text = "" CourseUnit5.Text = "" CourseUnit6.Text = "" CourseUnit7.Text = "" CourseUnit8.Text = ""
63

CourseUnit9.Text = "" CourseUnit10.Text = "" CourseUnit11.Text = "" CourseUnit12.Text = "" CourseUnit13.Text = "" CourseUnit14.Text = "" CourseUnit15.Text = "" CourseUnit16.Text = "" CourseUnit17.Text = "" CourseUnit18.Text = "" CourseUnit19.Text = "" CourseUnit20.Text = "" txtGPA.Text = "" End Sub End Class Final GPA Code Imports System.Data.SqlClient 'Imports Microsoft.VisualBasic.PowerPacks.Printing Public Class FinalGpa Dim dbs As New dbops Private Sub FinalGpa_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load txtSurname.Text = SessionSurname txtOthername.Text = SessionOthername txtMatric.Text = SessionMatric txtSession.Text = SessionSession 'txtGPA.Text = levelcgpa Dim h As String Dim t As String Dim th As String
64

Dim f As String Dim fi As String h = "FIRST SEMESTER" + vbCrLf h = h + logged.cCode1.Text + " " + "===>" + " " + logged.txtGrade1.Text + vbCrLf h = h + logged.cCode2.Text + " " + "===>" + " " + logged.txtGrade2.Text + vbCrLf h = h + logged.cCode3.Text + " " + "===>" + " " + logged.txtGrade3.Text + vbCrLf h = h + logged.cCode4.Text + " " + "===>" + " " + logged.txtGrade4.Text + vbCrLf h = h + logged.cCode5.Text + " " + "===>" + " " + logged.txtGrade5.Text + vbCrLf h = h + logged.cCode6.Text + " " + "===>" + " " + logged.txtGrade6.Text + vbCrLf h = h + logged.cCode7.Text + " " + "===>" + " " + logged.txtGrade7.Text + vbCrLf h = h + logged.cCode8.Text + " " + "===>" + " " + logged.txtGrade8.Text + vbCrLf h = h + logged.cCode9.Text + " " + "===>" + " " + logged.txtGrade9.Text + vbCrLf h = h + logged.cCode10.Text + " " + "===>" + " " + logged.txtGrade10.Text + vbCrLf h = h + vbCrLf h = h + "SECOND SEMESTER" + vbCrLf h = h + logged.cCode11.Text + " " + "===>" + " " + logged.txtGrade11.Text + vbCrLf h = h + logged.cCode12.Text + " " + "===>" + " " + logged.txtGrade12.Text + vbCrLf h = h + logged.cCode13.Text + " " + "===>" + " " + logged.txtGrade13.Text + vbCrLf h = h + logged.cCode14.Text + " " + "===>" + " " + logged.txtGrade14.Text + vbCrLf h = h + logged.cCode15.Text + " " + "===>" + " " + logged.txtGrade15.Text + vbCrLf
65

h = h + logged.cCode16.Text + " " + "===>" + " " + logged.txtGrade16.Text + vbCrLf h = h + logged.cCode17.Text + " " + "===>" + " " + logged.txtGrade17.Text + vbCrLf h = h + logged.cCode18.Text + " " + "===>" + " " + logged.txtGrade18.Text + vbCrLf h = h + logged.cCode19.Text + " " + "===>" + " " + logged.txtGrade19.Text + vbCrLf h = h + logged.cCode20.Text + " " + "===>" + " " + logged.txtGrade20.Text + vbCrLf Me.Year1.Text = h t = "FIRST SEMESTER" + vbCrLf t = t + _200Level.cCode1.Text + " " + "===>" + " " + _200Level.txtGrade1.Text + vbCrLf t = t + _200Level.cCode2.Text + " " + "===>" + " " + _200Level.txtGrade2.Text + vbCrLf t = t + _200Level.cCode3.Text + " " + "===>" + " " + _200Level.txtGrade3.Text + vbCrLf t = t + _200Level.cCode4.Text + " " + "===>" + " " + _200Level.txtGrade4.Text + vbCrLf t = t + _200Level.cCode5.Text + " " + "===>" + " " + _200Level.txtGrade5.Text + vbCrLf t = t + _200Level.cCode6.Text + " " + "===>" + " " + _200Level.txtGrade6.Text + vbCrLf t = t + _200Level.cCode7.Text + " " + "===>" + " " + _200Level.txtGrade7.Text + vbCrLf t = t + _200Level.cCode8.Text + " " + "===>" + " " + _200Level.txtGrade8.Text + vbCrLf t = t + _200Level.cCode9.Text + " " + "===>" + " " + _200Level.txtGrade9.Text + vbCrLf t = t + _200Level.cCode10.Text + " " + "===>" + " " + _200Level.txtGrade10.Text + vbCrLf t = t + vbCrLf t = t + "SECOND SEMESTER" + vbCrLf

66

t = t + _200Level.cCode11.Text + " " + "===>" + " " + _200Level.txtGrade11.Text + vbCrLf t = t + _200Level.cCode12.Text + " " + "===>" + " " + _200Level.txtGrade12.Text + vbCrLf t = t + _200Level.cCode13.Text + " " + "===>" + " " + _200Level.txtGrade13.Text + vbCrLf t = t + _200Level.cCode14.Text + " " + "===>" + " " + _200Level.txtGrade14.Text + vbCrLf t = t + _200Level.cCode15.Text + " " + "===>" + " " + _200Level.txtGrade15.Text + vbCrLf t = t + _200Level.cCode16.Text + " " + "===>" + " " + _200Level.txtGrade16.Text + vbCrLf t = t + _200Level.cCode17.Text + " " + "===>" + " " + _200Level.txtGrade17.Text + vbCrLf t = t + _200Level.cCode18.Text + " " + "===>" + " " + _200Level.txtGrade18.Text + vbCrLf t = t + _200Level.cCode19.Text + " " + "===>" + " " + _200Level.txtGrade19.Text + vbCrLf t = t + _200Level.cCode20.Text + " " + "===>" + " " + _200Level.txtGrade20.Text + vbCrLf Me.year2.Text = t th = "FIRST SEMESTER" + vbCrLf th = th + _300level.cCode1.Text + " " + "===>" + " " + _300level.txtGrade1.Text + vbCrLf th = th + _300level.cCode2.Text + " " + "===>" + " " + _300level.txtGrade2.Text + vbCrLf th = th + _300level.cCode3.Text + " " + "===>" + " " + _300level.txtGrade3.Text + vbCrLf th = th + _300level.cCode4.Text + " " + "===>" + " " + _300level.txtGrade4.Text + vbCrLf th = th + _300level.cCode5.Text + " " + "===>" + " " + _300level.txtGrade5.Text + vbCrLf th = th + _300level.cCode6.Text + " " + "===>" + " " + _300level.txtGrade6.Text + vbCrLf

67

th = th + _300level.cCode7.Text + " " + "===>" + " " + _300level.txtGrade7.Text + vbCrLf th = th + _300level.cCode8.Text + " " + "===>" + " " + _300level.txtGrade8.Text + vbCrLf th = th + _300level.cCode9.Text + " " + "===>" + " " + _300level.txtGrade9.Text + vbCrLf th = th + _300level.cCode10.Text + " " + "===>" + " " + _300level.txtGrade10.Text + vbCrLf th = th + vbCrLf th = th + "SECOND SEMESTER" + vbCrLf th = th + _300level.cCode11.Text + " " + "===>" + " " + _300level.txtGrade11.Text + vbCrLf th = th + _300level.cCode12.Text + " " + "===>" + " " + _300level.txtGrade12.Text + vbCrLf th = th + _300level.cCode13.Text + " " + "===>" + " " + _300level.txtGrade13.Text + vbCrLf th = th + _300level.cCode14.Text + " " + "===>" + " " + _300level.txtGrade14.Text + vbCrLf th = th + _300level.cCode15.Text + " " + "===>" + " " + _300level.txtGrade15.Text + vbCrLf th = th + _300level.cCode16.Text + " " + "===>" + " " + _300level.txtGrade16.Text + vbCrLf th = th + _300level.cCode17.Text + " " + "===>" + " " + _300level.txtGrade17.Text + vbCrLf th = th + _300level.cCode18.Text + " " + "===>" + " " + _300level.txtGrade18.Text + vbCrLf th = th + _300level.cCode19.Text + " " + "===>" + " " + _300level.txtGrade19.Text + vbCrLf th = th + _300level.cCode20.Text + " " + "===>" + " " + _300level.txtGrade20.Text + vbCrLf Me.year3.Text = th f = "FIRST SEMESTER" + vbCrLf f = f + _400level.cCode1.Text + " " + "===>" + " " + _400level.txtGrade1.Text + vbCrLf

68

f = f + _400level.cCode2.Text + " " + "===>" + " " + _400level.txtGrade2.Text + vbCrLf f = f + _400level.cCode3.Text + " " + "===>" + " " + _400level.txtGrade3.Text + vbCrLf f = f + _400level.cCode4.Text + " " + "===>" + " " + _400level.txtGrade4.Text + vbCrLf f = f + _400level.cCode5.Text + " " + "===>" + " " + _400level.txtGrade5.Text + vbCrLf f = f + _400level.cCode6.Text + " " + "===>" + " " + _400level.txtGrade6.Text + vbCrLf f = f + _400level.cCode7.Text + " " + "===>" + " " + _400level.txtGrade7.Text + vbCrLf f = f + _400level.cCode8.Text + " " + "===>" + " " + _400level.txtGrade8.Text + vbCrLf f = f + _400level.cCode9.Text + " " + "===>" + " " + _400level.txtGrade9.Text + vbCrLf f = f + _400level.cCode10.Text + " " + "===>" + " " + _400level.txtGrade10.Text + vbCrLf f = f + vbCrLf f = f + "SECOND SEMESTER" + vbCrLf f = f + _400level.cCode11.Text + " " + "===>" + " " + _400level.txtGrade11.Text + vbCrLf f = f + _400level.cCode12.Text + " " + "===>" + " " + _400level.txtGrade12.Text + vbCrLf f = f + _400level.cCode13.Text + " " + "===>" + " " + _400level.txtGrade13.Text + vbCrLf f = f + _400level.cCode14.Text + " " + "===>" + " " + _400level.txtGrade14.Text + vbCrLf f = f + _400level.cCode15.Text + " " + "===>" + " " + _400level.txtGrade15.Text + vbCrLf f = f + _400level.cCode16.Text + " " + "===>" + " " + _400level.txtGrade16.Text + vbCrLf f = f + _400level.cCode17.Text + " " + "===>" + " " + _400level.txtGrade17.Text + vbCrLf f = f + _400level.cCode18.Text + " " + "===>" + " " + _400level.txtGrade18.Text + vbCrLf
69

f = f + _400level.cCode19.Text + " " + "===>" + " " + _400level.txtGrade19.Text + vbCrLf f = f + _400level.cCode20.Text + " " + "===>" + " " + _400level.txtGrade20.Text + vbCrLf Me.year4.Text = f fi = "FIRST SEMESTER" + vbCrLf fi = fi + _500level.cCode1.Text + " " + "===>" + " " + _500level.txtGrade1.Text + vbCrLf fi = fi + _500level.cCode2.Text + " " + "===>" + " " + _500level.txtGrade2.Text + vbCrLf fi = fi + _500level.cCode3.Text + " " + "===>" + " " + _500level.txtGrade3.Text + vbCrLf fi = fi + _500level.cCode4.Text + " " + "===>" + " " + _500level.txtGrade4.Text + vbCrLf fi = fi + _500level.cCode5.Text + " " + "===>" + " " + _500level.txtGrade5.Text + vbCrLf fi = fi + _500level.cCode6.Text + " " + "===>" + " " + _500level.txtGrade6.Text + vbCrLf fi = fi + _500level.cCode7.Text + " " + "===>" + " " + _500level.txtGrade7.Text + vbCrLf fi = fi + _500level.cCode8.Text + " " + "===>" + " " + _500level.txtGrade8.Text + vbCrLf fi = fi + _500level.cCode9.Text + " " + "===>" + " " + _500level.txtGrade9.Text + vbCrLf fi = fi + _500level.cCode10.Text + " " + "===>" + " " + _500level.txtGrade10.Text + vbCrLf fi = fi + vbCrLf fi = fi + "SECOND SEMESTER" + vbCrLf fi = fi + _500level.cCode11.Text + " " + "===>" + " " + _500level.txtGrade11.Text + vbCrLf fi = fi + _500level.cCode12.Text + " " + "===>" + " " + _500level.txtGrade12.Text + vbCrLf fi = fi + _500level.cCode13.Text + " " + "===>" + " " + _500level.txtGrade13.Text + vbCrLf

70

fi = fi + _500level.cCode14.Text + " " + "===>" + " " + _500level.txtGrade14.Text + vbCrLf fi = fi + _500level.cCode15.Text + " " + "===>" + " " + _500level.txtGrade15.Text + vbCrLf fi = fi + _500level.cCode16.Text + " " + "===>" + " " + _500level.txtGrade16.Text + vbCrLf fi = fi + _500level.cCode17.Text + " " + "===>" + " " + _500level.txtGrade17.Text + vbCrLf fi = fi + _500level.cCode18.Text + " " + "===>" + " " + _500level.txtGrade18.Text + vbCrLf fi = fi + _500level.cCode19.Text + " " + "===>" + " " + _500level.txtGrade19.Text + vbCrLf fi = fi + _500level.cCode20.Text + " " + "===>" + " " + _500level.txtGrade20.Text + vbCrLf Me.Year5.Text = fi txtFinal.Text = FormatNumber(levelcgpa, 2) If Val(txtFinal.Text) > 4.5 Then lblResult.Text = "FIRST CLASS" lblCom.Text = "EXCELLENT" ElseIf Val(txtFinal.Text) < 4.5 And Val(txtFinal.Text) > 3.4 Then lblResult.Text = "SECOND CLASS UPPER" lblCom.Text = "VERY GOOD" ElseIf Val(txtFinal.Text) < 3.5 And Val(txtFinal.Text) > 2.4 Then lblResult.Text = "SECOND CLASS LOWER" lblCom.Text = "GOOD" ElseIf Val(txtFinal.Text) < 2.5 Then lblResult.Text = "THIRD CLASS" lblCom.Text = "POOR" End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click conmsg = MsgBox("Do you want to close this window", MsgBoxStyle.YesNo, "Exit Window") If conmsg = 6 Then
71

Me.Close() End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 'PrintForm1.Print() 'FinalGpa.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable) PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable) End Sub End Class

72

You might also like