/*********************************************
Days Past
This program reads a start date and an end date
from the user, and prints out the number of
days ellapsed between the two.
The key to the problem is to write a function
"monthread()" that reads a month from the user
and returns the number of days from New Year's
to the beginning of that month.
*********************************************/#include <iostream>#include <string>usingnamespacestd;intmonthread();/*********************************************
** main() functions
*********************************************/intmain(){inta, ds, df;// Get # of days from New Year's to startcout<<"Enter start date (e.g. 27 Mar): ";cin>>a;ds=a+monthread();// Get # of days from New Year's to finish cout<<"Enter ending date (e.g. 13 Jul): ";cin>>a;df=a+monthread();// Print out number of days in betweencout<<"That lasted "<<df-ds<<" days. "<<"Or "<<df-ds+1<<" depending on "<<"how you count."<<endl;return0;}/*********************************************
** Reads a month and returns the number of
** days from New Year's to that month
*********************************************/intmonthread(){// Read in the stringM;cin>>M;// Get # of days from monthintd;if(M=="Jan")d=0;elseif(M=="Feb")d=31;elseif(M=="Mar")d=59;elseif(M=="Apr")d=90;elseif(M=="May")d=120;elseif(M=="Jun")d=151;elseif(M=="Jul")d=181;elseif(M=="Aug")d=212;elseif(M=="Sep")d=243;elseif(M=="Oct")d=273;elseif(M=="Nov")d=304;elsed=334;returnd;}