I'm trying to make a program to calculate tomorrow's date, but I've come across some problems. Leap years don't matter, February always has 28 days. A loop must be used.
//Date.cpp – displays an item name and a quantity in inventory
#include <iostream>
#include "c:\Users\Documents\Visual Studio 2008\Projects\Date solution\Date\MydateClass.h"
using std::cout;
using std::cin;
using std::endl;
int main()
{
//declare a date object
MyDate today;
//declare variables
int todayMonth = 0;
int todayDay = 0;
int todayYear = 0;
//get month,day, and year from user
cout << "Enter the month (1-12): ";
cin >> todayMonth;
cout << "Enter the day (1-31): ";
cin >> todayDay;
cout << "Enter the year: ";
cin >> todayYear;
//use public member method to assign values to private data members
today.SetDate(todayMonth, todayDay, todayYear);
//use public member method to display values in private data members
cout << endl << "Today is ";
today.DisplayDate();
cout << "." << endl;
today.UpdateDate();
cout << "Tomorrow is ";
today.DisplayDate();
cout << "." << endl;
return 0;
} //end of main function
I have multiple errors when I do this, but I don't see how else to do the problem. I also do not know where to incorporate a loop.