Homework 6 - Structures

Due: Monday November 15, 2010 at 5:00pm

The purpose of this assignment is to create a small student gradebook using an array of structures. Each structure will be a single student record for the class. Name your source code hw6.cpp.

The structure should be called StudentRecord. It will have the following member variables:

You MUST enforce the following data constraints when reading input from the user. Use an input validation loop to reject any invalid input and ask the user for new data: In main(), you will create an array of StudentRecords and use a menu to manipulate this array. As with Homework 5, each menu item will call a function, passing the array to the function. The ONLY global variable allowed will be the maximum capacity of the array. ALL other variables MUST be local to their functions or the main() function.

Use the following menu for the program:

  Welcome to the StudentRecord Gradebook
  ======================================
  1.  Enter student data for the class
  2.  Print all student records
  3.  Print a single student record

  0.  Exit
  ======================================
  Enter selection:
You will be using a variety of functions to implement these options. Option 1 will call an overall getAllStudents() function. Option 2 will check if student data has been entered. If there are students, it will call a printAllStudents() function. If there are no students, it will remind the user to select Option 1 first. Option 3 will also check if student data has been entered and remind the user to select Option 1 first if there are no students. If there are students, Option 3 will call the printSelectedStudent() function.

The required functions are as follows:

Email your completed source code to me.