Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++. Complete the implementation of the class date that represents dates written in the form day/month/year. Do not modify the main program. You must

Using C++. Complete the implementation of the class date that represents dates written in the form day/month/year. Do not modify the main program. You must write the prototypes and the definitions of the methods of the class.

?

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Declaration of Class Date /* File: date. h A class representing dates in the form: day , month and year dat e s are written to a stream in the form day/month/ year day_number ( ) returns the number of days since 1/1 of the current year including the current day days_between ( ) returns the number of days between two dates not including the first day but including the last day. */ #ifndef DATE H #define DATE_H #include #include using namespace std ; class date { private : int day ; int month ; int year ; public : // you fill in the method prototypes } ; #endif /* DATE H */Implementation of Class Date /* File : date. cpp Implementation of class date */ #include "date.h" #include // number of days in each month const int DAYS [ 12 ] = (31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 }; 1710101010101010IIIIIIIII Methods of date /1 1 1 1 1 1 1 1 1 1 1 1IIIIIIIIIIIIIIIMain Program Using Class Date /* File : testdate. cpp Application program using class time Programmer : your name Date : */ #include "date.h" int main (void) { ofstream fout ( "date. txt") ; date d(12 , 6 , 2016); date e (14 , 9 , 2018); fout

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions