/*
File name: hw7 .h
Author: Bo Bayles
E-mail address: bmb3h6@umr.edu  
Description: This is the header file that declares the structs and
  used by hw7.cpp.
*/

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

#include <iostream>
using namespace std;

struct Flight
{
  char flightNumber[10];
  char airlineName[50];
  char cityDepart[50];
  char cityDest[50];
  float fPrice;
  float fDistance;
};
//Declare the Flight struct, with the appropriate members.

char DisplayMenu();
//Pre: No paramaters.
//Post: The menu is displayed, the user's choice is returned.

void AddFlight(Flight flights[], const int iFlights);
//Pre: flights is the array of structs of type Flight. iFlights is a 
//  non-negative integer indicating the number of flights that are in 
//  the array.
//Post: The array is modified by reference, nothing is returned.

void DispFlights(const Flight flights[], const int iFlights);
//Pre: flights is the array of structs of type Flight. iFlights is a 
//  non-negative integer indicating the number of flights that are in 
//  the array.
//Post: The flights' data are displayed, nothing is returned.

int findSmallest(const Flight flights[], const int iSize, const int iStart,
                 const int iSortWhat);
//Pre: flights is the array of structs of type Flight. iSize is an integer
//  indicating the size of the array. iStart is an integer indicating
//  the position from which sorting should take place. iSortWhat is 
//  an integer indicating the sort criteria. 2 is by .cityDepart, 3 is
//  by .cityDest, and 4 is .fPrice / .fDistance .
//Post: The smallest value found is returned to the calling function.
                 
void swap(Flight flights[], const int iSize, const int iPos1, const int iPos2);
//Pre: flights is the array of structs of type Flight. iSize is an integer
//  indicating the size of the array. iStart is an integer indicating
//  the position from which sorting should take place. iPos1 and iPos2
//  are integers indicating what positions need to be swapped.
//Post: The array is modified by reference, nothing is returned.

void selectSort(Flight flights[], const int iSize, const int iSortWhat);
//Pre: flights is the array of structs of type Flight. iSize is an integer
//  indicating the size of the array. iStart is an integer indicating
//  the position from which sorting should take place. iSortWhat is 
//  an integer indicating the sort criteria. 2 is by .cityDepart, 3 is
//  by .cityDest, and 4 is .fPrice / .fDistance .
//Post: The array is modified by reference, nothing is returned.

void findDirect(const Flight flights[], const int iFlights);
//Pre: flights is the array of structs of type Flight. iFlights is a 
//  non-negative integer indicating the number of flights that are in 
//  the array.
//Post: The matchin flight's data are displaed, nothing is returned.
#endif

