//Andres Guzman CSC5 Chapter 4, P. 220, #3
//
/**************************************************************
*
* DETERMINE IF THE DATE IS MAGIC
* ____________________________________________________________
* This program will compute if the month and day equals the year
*
* Computation is based on the formula:
* magic_date = date * month
* ____________________________________________________________
* INPUT
* day = The inputed day of the month
* month = The inputed month of the year
* year = The inputed year
* OUTPUT
* magic_date = Displays a message if the year can be found with the day and
* month
*
**************************************************************/
#include <iostream>
using namespace std;
int main()
{
int day; //Day of the year
int month; //Month of the year
int year; //The desired year
int magic_date; //The formula needed to display message
//
//
cout << "Day: ";
cin >> day;
cout << "\nMonth: ";
cin >> month;
cout<< "\nYear: ";
cin >> year;
cout << "\n";
//
//
if (day > 31)
cout << "Invalid Day";
if (month > 12)
cout << "\nInvalid Month";
if (year > 99)
cout << "\nInvalid Year\n";
//
//
cout << day << "/" << month << "/" << year << "\n";
//
//
magic_date = day * month;
//
//
if (year == magic_date)
cout << "The date is magic!";
else
cout << "The date is not magic.";
}