C++ Month, day, and year validation
<p>I'm currently working on a project for my intro to C++ programming class. The project asks a user to enter a date using mm/dd/yyyy format. Based on the information given, the program then has to determine if the date is valid or invalid, then displays a response to that. I'm facing the problem currently where everything is coming out reading "Good date!" I'm not sure where the problem is. Any help is appreciated. If you could help point me in the right direction, that would be awesome.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;

using namespace std;

void getDate(int *month, int *day, int *year);
int checkDate(int month, int day, int year);
void displayMessage(int status);

int main()
{
    int month, day, year;
    int s = 0;

    getDate(&amp;month, &amp;day, &amp;year);
    do
    {
        checkDate(month, day, year);
        displayMessage(s);
        getDate(&amp;month, &amp;day, &amp;year);
    } 
    while (_getch() != EOF);
}

void getDate(int *month, int *day, int *year)
{
    char fill;
    fill = '/';
    cout &lt;&lt; "Enter a date in mm/dd/yyyy form: ";
    cin &gt;&gt; *month;
    if (cin.get() != '/')
    {
        cout &lt;&lt; "expected /" &lt;&lt; endl;
    }
    cin &gt;&gt; *day;
    if (cin.get() != '/')
    {
        cout &lt;&lt; "expected /" &lt;&lt; endl;
    }
    cin &gt;&gt; *year;
    cout &lt;&lt; *month &lt;&lt; fill &lt;&lt; *day &lt;&lt; fill &lt;&lt; *year &lt;&lt; endl;
};

int checkDate(int month, int day, int year)
{
    if ((month = 1) || (month = 3) || (month = 5) || (month = 7) ||
        (month = 8) || (month = 10) || (month = 12))
    {
        day &lt;= 31;
    }
    else if ((month = 4) || (month = 6) || (month = 9) || (month = 11))
    {
        day &lt;= 30;
    }
    else if ((month = 2) &amp;&amp; (year % 4 == 0))
    {
    day &lt;= 29;
    }
    else if ((month = 2) &amp;&amp; (year % 4 != 0))
    {
        day &lt;= 28;
    };
    int status = 0;
    if ((year &lt; 999) || (year &gt; 10000))
    {
        status == 1;
    }
    if ((month &lt; 1) || (month &gt; 12))
    {
        status == 2;
    }
    else if ((day &lt; 1) || (day &gt; 31))
    {
        status == 3;
    }
    else if ((day &lt; 1) || (day &gt; 30))
    {
        status == 4;
    }
    else if ((day &lt; 1) || (day &gt; 29))
    {
        status == 5;
    }
    else if ((day &lt; 1) || (day &gt; 28))
    {
        status == 6;
    }
    return status;
};

void displayMessage(int status)
{
    if (status == 0)
    {
        cout &lt;&lt; "Good date!" &lt;&lt; endl;
    }
    if (status == 1)
    {
        cout &lt;&lt; "Bad year" &lt;&lt; endl;
    }
    if (status == 2)
    {
        cout &lt;&lt; "Bad month" &lt;&lt; endl;
    }
    if (status == 3)
    {
        cout &lt;&lt; "Bad day. Not 1-31" &lt;&lt; endl;
    }
    if (status == 4)
    {
        cout &lt;&lt; "Bad day, not 1-30" &lt;&lt; endl;
    }
    if (status == 5)
    {
        cout &lt;&lt; "Bad day, not 1-29" &lt;&lt; endl;
    }
    if (status == 6)
    {
        cout &lt;&lt; "Bad day, not 1-28" &lt;&lt; endl;
    }
    _getch();
}
</code></pre>