/*
File name: hw6.h
Author: Bo Bayles
E-mail address: bmb3h6@umr.edu  
Description: This is the header file containing the function
  declarations for the DisplayMenu, AddCourse, ModCourse, DispCourse,
  CalcHours, CalcGpa, and CalcGrade functions. It also contains the
  definition of the Course struct.
*/

#ifndef HW6_H
#define HW6_H
//Include everything that's not already defined.

#include <string>
#include <iostream>
using namespace std;
//Include string.h for the string data type.

struct Course
{
  string cName;
  int hours;
  char grade;
};
/*
Declare the Course struct.
cName is a string with no whitespace.
hours is a value greater than 0 and no more than 13 of type integer.
grade is a value of type character equal to A, B, C, D, or F.
*/

char DisplayMenu(int const iClasses, const int iHours, const float fGpa, 
                 const string letterGrade);
/*Pre: iClasses is a valid non-negative value of type int.
       iHours is a valid non-negative value of type int.
       fGpa is a valid non-negative value for type float
  Post: The menu is displayed on the screen.
        The current number of classes, the current GPA, and grades are
          displayed on the screen.
        The user is prompted for a choice from the menu, which
          validated.
        The validated user choice of type char is returned to the
          calling function.
*/

void AddCourse(Course courses[], const int iClasses);
/*Pre: courses is a struct of type Course containing a class name (string),
         number of hours (int), and a grade (char).
       iClasses is a valid non-negative value of type int.
  Post: The user is prompted to initialize each member of the Course
          struct for the current array position.
        The array of type Course is modified by reference.
*/

void DispCourses(Course courses[], int iClasses);
/*Pre: courses is a struct of type Course containing a class name (string),
         number of hours (int), and a grade (char).
       iClasses is a valid non-negative value of type int.
  Post: Each member of each structure in each position of the array is
          displayed on the screen.
        Nothing is returned or modified.
*/

void ModCourse(Course courses[], const int iClasses);
/*Pre: courses is a struct of type Course containing a class name (string),
         number of hours (int), and a grade (char).
       iClasses is a valid non-negative value of type int.
  Post: The DispCourses function is called to prompt the user for what
          position of the array is to be modified.
        The AddCourse function is called with the user's choice for
          the array position.
        The array of type Course is modified by reference. 
*/

int CalcHours(Course courses[], const int iClasses);
/*Pre: courses is a struct of type Course containing a class name (string),
         number of hours (int), and a grade (char).
       iClasses is a valid non-negative value of type int.
       iHours is a valid non-negative value of type int.
  Post: The total number of hours is determined by adding all the hour
          members of all the structs in the array.
        iHours is returned to the calling function.
*/

float CalcGpa (Course courses[], const int iClasses, const int iHours);
/*Pre: courses is a struct of type Course containing a class name (string),
         number of hours (int), and a grade (char).
       iClasses is a valid non-negative value of type int.
       iHours is a valid non-negative value of type int.
  Post: Each grade member of each Course struct in the courses array is
         associated with a multiplier. 4 corresponds to A, 3 to B, 2 to
         C, 1 to D, and 0 to F.
        Each multiplier is multiplied by the number of hours and added
          to the fGpa total.
        Finally, fGpa is divided by the total number of hours.
        fGpa is returned to the calling function. 
*/

string CalcGrade (const float fGpa, const int iClasses);
/*Pre: fGpa is a positive float between 0 and 4.
       iClasses is a valid non-negative value of type int.
  Post: fGpa is associated with a letter grade. From 4.0 to 3.85 is A,
          3.85 to 3.7 is A-, 3.7 to 3.3 is B+, 3.3 to 3.0 is B, 3.0 to
          2.7 is B-, 2.7 to 2.3 is C+, 2.3 to 2.0 is C, 2.0 to 1.7 is
          C-, 1.7 to 1.3 is D+, 1.3 to 1.0 is D, 1.0 to 0.7 is D-, and
          0.7 to 0 is F.
        The associated letter grade is returned to the calling function
          as a string.
*/
#endif

