Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in C++ program. The header, implementation and driver files should be respectively named : Calendar.h , Calendar.cpp and TestCalendar.cpp. Please post a picture of

Write in C++ program. The header, implementation and driver files should be respectively named : Calendar.h, Calendar.cpp and TestCalendar.cpp. Please post a picture of sample output for a proof that it works.

image text in transcribed

Develop in C+ operations a class date to represent a calendar. The class should provide the following A default constructor that initializes a date obiect to 01-01-1900 . A class constructor that initializes a date object to a correct value using three integer parameters corresponding to the desired month, day and year The function toString() that returns the string version of a date object. For example, applying toString() to the date 12-01-2000 produces "December 1st, 2000". The function nextDate () that returns the successive date i.e. the new value of the date object. For example, applying nextDate) to the date 12-31-2000 produces a new date: 01-01-2001. You should take into account if the year is a leap year or not. A leap year is: (1) divisible by 400 or (2) divisible by 4 and not divisible by 100 The function compareDates ) that checks if the date of interest is before, after or equal to the argument date. A simple run of the driver program follows 12-32-2000 Enter the first date using the format mm-dd-yyyy: Incorrect day! Enter the first date using the format mm-dd-yyyy: The string version of the date is: December 31st, 2000 The next date in string version is: January 1st, 2001 Enter the second date using the format mm-dd- The first date comes before the second one 12-31-2000 yyyy: 12-01-2001 Another run: Enter the first date using the format mm-dd-yyyy: The string version of the date is: February 28th, 2005 The next date in string version is: March 1st, 2005 Enter the second date using the format mm-dd-yyyy: The first date comes after the second one 02-28-2005 01-10-2005

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

Summarize training and development implementation issues.

Answered: 1 week ago

Question

3. What information do participants need?

Answered: 1 week ago