/*
File name: hw7.cpp
Author: Bo Bayles
E-mail address: bmb3h6@umr.edu  
Description: This program keeps track of the data for flights entered
  by the user, then sorts and displays them based on user-selected
  criteria.
*/

#include "hw7.h"
#include <iostream>
using namespace std;


int main()
{
  int iFlights = 0;
  char cMenu;
  Flight flights[50];
  
  do
  {
    cMenu = DisplayMenu();

    switch (cMenu)
    {
      case '1':
              if (iFlights == 50)
              {
              cout << endl << "You may only enter 50 flights." << endl;
              break;
              }
              //Stop adding flights after 50 are entered.
              
              AddFlight(flights, iFlights);
              iFlights++;
              //Increment the flight count after calling AddFlights.
              break;
            
      case '2':
              selectSort(flights, iFlights, 2);
              DispFlights(flights, iFlights);
              //Call selecSorts with the 2, then DispFlights.
              break;
            
      case '3':
              selectSort(flights, iFlights, 3);
              DispFlights(flights, iFlights);
              //Call selecSorts with the 3, then DispFlights.
              break;
            
      case '4':
              selectSort(flights, iFlights, 4);
              DispFlights(flights, iFlights);
              //Call selecSorts with the 4, then DispFlights.
              break;
              
      case '5':
              findDirect(flights, iFlights);
              //Call findDirect.
              break;
              
      case '6':
              break;
              
      default:
             cout << endl << "Invalid entry." << endl;
             break;
             //Catch bad entries.
    }
  }  
  while(cMenu != '6');
  //Loop until the user chooses to quit.
  
  cout << endl << "Exiting..." << endl;
  return 0;
}


