Block of Code

Practical Examples for Programmers

  • Home
  • C++
  • Java
  • Visual Basic
  • Discrete Math
  • Ask a Question

Grade Book

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:

  1. Use a navigation toolbar to fill the Grades table.
  2. 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.

Grade Book Screenshot

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

Secondary Sidebar

This is the secondary sidebar

Copyright © 2025 · Metro Pro Theme on Genesis Framework · WordPress · Log in