So I'm putting together this program that takes 4 values for each month of the year. The only issue I'm having is that after I put in the last input for December, the loop continues and starts over to January. What am I forgetting?
#include <iostream>
#include <iomanip>
using namespace std;
enum Month {January,February,March,April,May,June,July,August,September,October,November,December };
void displayMonthName (Month );
struct Airport
{
int numLanded;
int numDeparted;
int mostLanded;
int leastLanded;    
};
int main ()
{
int count;
const int MAX = 12;
double total = 0.0;
double average;
Airport year[MAX];
Month months;
for (count = 0 ; count < MAX ; count++)
{
    for ( months = January; months <= December ; months= static_cast <Month>(months + 1))       
        {
            cout<< "Enter the number of planes landed in ";
            displayMonthName(months);
            cout<<"\t";
            cin>>year[count].numLanded;
            cout<< "Enter the number of planes that landed in ";
            displayMonthName(months);
            cout<<"\t";
            cin>>year[count].numDeparted;
            cout<< "Enter the greatest number of planes that landed on a single day in ";
            displayMonthName(months);
            cout<<"\t";
            cin>>year[count].mostLanded;
            cout<< "Enter the least number of planes that landed on a single day in ";
            displayMonthName(months);
            cout<<"\t";
            cin>>year[count].leastLanded;
            cout << endl;
        }
}
Here's the void function, but I am sure this does not have anything to do with it.
void displayMonthName(Month m)
{
switch (m)
{
    case January    : cout<< "January";
                        break;
    case February   : cout<< "February";
                        break;
    case March      : cout<< "March";
                        break;
    case April      : cout<< "April";
                        break;
    case May        : cout<< "May";
                        break;
    case June       : cout<< "June";
                        break;
    case July       : cout<< "July";
                        break;
    case August     : cout<< "August";
                        break;  
    case September  : cout<< "September";
                        break;
    case October    : cout<< "October";
                        break;
    case November   : cout<< "November";
                        break;
    case December   : cout<< "December";                
}
}
 
     
    