//Jacob Silvestre CSC5 Chapter 4, P. 220, #3
//
/************************************************************************************
*
* CALCULATE MAGIC BIRTHDATE
*____________________________________________________________________________________
* This program asks the user to enter a month, day, and two-digit year to determine
* calculate whether the date is a magic date. A date is considered magic when the
* month multiplied by the day is equal to the two-digit year.
*
* Magic Date Formula:
* Month x Day = Year
*____________________________________________________________________________________
* INPUT
* month : Month entered as a number
* day : Day entered by user
* year : Two-digit year entered by user
*
* OUTPUT
* Displays whether the date is magic or not
*
**************************************************************************************/
#include <iostream>
using namespace std;
int main()
{
int month; // INPUT - Month number
int day; // INPUT - Day number
int year; // INPUT - Two-digit year
//
// Input Date
//
cout << "Enter the month as a number: ";
cin >> month;
cout << "Enter the day: ";
cin >> day;
cout << "Enter the two-digit year: ";
cin >> year;
//
// Determine if Date is Magic
//
if (month * day == year)
{
cout << "The date is magic!" << endl;
}
else
{
cout << "The date is not magic." << endl;
}
return 0;
}