A teacher maintains a database containing two tables–Students and Grades. The Students table has three fields: studentID, lastName and firstName. The Grades table has four fields: studentID, firstExam, secondExam, and finalExam. At the beginning of the semester, the Students table is filled in completely with a record for each student in a class, and the Grades table has a record for each student that contains only the student’s ID number. (Note: The database is contained in the file Gradebook.accdb). Using Visual Basic write a program that allows the instructor to record and process the grades for the semester. The program should do the following:
- Use a navigation toolbar to fill the Grades table.
- After all grades have been entered, display a DataGridView control showing the name of each student and his or her semester average. The semester average should be calculated as (firstExam + secondExam + 2 * finalExam) / 4. See the figure below.
Suggested Control Names and Attributes:
Name Property | Text Property | Control Type | Notes |
frmGradeBook | Grade Book | Form | Holds Controls |
txtID | TextBox | Capture student ID | |
txtExam1 | TextBox | Captures score for exam 1 | |
txtExam2 | TextBox | Captures score for exam 2 | |
txtFinal | TextBox | Captures score for final | |
btnDisplay | Display Student Grades | Button | Triggers event to display data |
dgvOutput | DataGridView | Displays data |