#Making a bool function help...

4 messages · Page 1 of 1 (latest)

past echoBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

rotund wigeon
#

my main:


int main() {
  int tempMonth, tempDay, tempYear;
  Date date1;

  cout << "Testing the default constructor and the getters" << endl
       << "The initialized date is (M-D-Y): ";
  
  cout << date1.getMonth() << "-" << date1.getDay() << "-" << date1.getYear() << endl;

  cout << "Please enter a date (M-D-Y): ";
  cin >> tempMonth >> tempDay >> tempYear;

  date1.setMonth(tempMonth);
  date1.setDay(tempDay);
  date1.setYear(tempYear);

  cout << "Please enter a second date (M-D-Y): ";
  cin >> tempMonth >> tempDay >> tempYear;

  Date date2(tempMonth, tempDay, tempYear);

  cout << endl << "Printing the two days:" << endl;
  cout << "The date is (M-D-Y): "; 
  date1.printDate();
  cout << endl;
  cout << "The date is (M-D-Y): ";
  date2.printDate();
  cout << endl;

  if(date1.sameDay(date2))
  {
    cout << "The two days are the same.";
  }
  else
  {
    cout << "The two days are different.";
  }
  
}```
past echoBOT
#

@rotund wigeon

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

rotund wigeon
#

!solved