Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Date.h"
- #include "Date.cpp"
- using namespace std;
- int main()
- {
- int tempMonth = 0;
- int tempDay = 0;
- int tempYear = 0;
- int DaysPerMonth[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
- cout << "Hello! This Program will Give You a Certain Date in 3 Different Formats\n\n";
- while (tempMonth < 1 || tempMonth > 12)
- {
- cout << "Month: \n\n";
- cin >> tempMonth;
- cout << endl;
- }
- while (tempDay > DaysPerMonth[tempMonth - 1] || tempDay < 1)
- {
- cout << "Day: \n\n";
- cin >> tempDay;
- cout << endl;
- }
- while (tempYear < 1)
- {
- cout << "Year: \n\n";
- cin >> tempYear;
- cout << endl;
- }
- Date *d = new Date(tempMonth, tempDay, tempYear);
- d->printDate1();
- d->printDate2();
- d->printDate3();
- system("Pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment