//Jeremy Huang CS1A Chapter 4, P. 220, #3
//
/**************************************************************
*
* CALCULATE INTEREST EARNED
* ____________________________________________________________
* This program calculates the total amount of savings and
* interest earned after one year based on a given principal,
* interest rate, and the number of times the interest is
* compounded annually.
* ____________________________________________________________
* INPUT
* month : the month
* day : the day
* year : the year
*
* OUTPUT
* N/A :cout shows whether it is magic or not
*
**************************************************************/
#include <iostream>
using namespace std;
int main( ) {
int month; //INPUT - the month
int day; //INPUT - the day
int year; //INPUT - the year
//User Input
cout << "Please enter a month in numeric form,"
<< " no zeros if it is a single digit: " << endl;
cin >> month;
cout << "Please enter a day in numeric form,"
<< " no zeros if it is a single digit: " << endl;
cin >> day;
cout << "Please enter the last 2 digits of a year: " << endl;
cin >> year;
//Output Result
if ( ( month* day) == year)
cout << "The date " << month<< "/" << day<< "/" << year<< " is magic!" ;
else
cout << "The date " << month<< "/" << day<< "/" << year<< " is not magic." ;
return 0 ;
}
Ly9KZXJlbXkgSHVhbmcgQ1MxQSBDaGFwdGVyIDQsIFAuIDIyMCwgIzMKLy8KLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAqCiAqIENBTENVTEFURSBJTlRFUkVTVCBFQVJORUQKICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiAqIFRoaXMgcHJvZ3JhbSBjYWxjdWxhdGVzIHRoZSB0b3RhbCBhbW91bnQgb2Ygc2F2aW5ncyBhbmQKICogaW50ZXJlc3QgZWFybmVkIGFmdGVyIG9uZSB5ZWFyIGJhc2VkIG9uIGEgZ2l2ZW4gcHJpbmNpcGFsLAogKiBpbnRlcmVzdCByYXRlLCBhbmQgdGhlIG51bWJlciBvZiB0aW1lcyB0aGUgaW50ZXJlc3QgaXMKICogY29tcG91bmRlZCBhbm51YWxseS4KICogX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19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