/* year5.cpp is a driver program to test function YearName().
 *
 * Input:  none
 * Output:names of years (Freshman, Sophomore, ... )
 ************************************************************/

#include <iostream.h>            // cout, <<
#include <string>                // string

string YearName(int yearCode);

int main()
{
   for (int i = 1; i <= 6; i++)
     cout << YearName(i) << endl;

   return 0;
}

/*** Insert the definition of YearName() from Figure 5.4 here ***/

/* YearName displays the name of a year, given a year code.
 *
 * Receive: An int year code (1-5)
 * Return:  The appropriate (string) year name
 *          (Freshman, Sophomore, Junior, Senior, Graduate)
 ************************************************************/

string YearName(int yearCode)
{
   switch (yearCode)
   {
      case 1:
               return "Freshman";
      case 2:
               return "Sophomore";
      case 3:
               return "Junior";
      case 4:
               return "Senior";
      case 5:
               return "Graduate";
      default:
               cerr << "YearName: code error: " << yearCode << endl;
               return "";
   }
}


