Question: Start with the above program group that prints a selected month and year calendar to the console. Create an output text file and write the
Start with the above program group that prints a selected month and year calendar to the console. Create an output text file and write the calendar to it for portability.
calendarType.h:
#ifndef calendarTypeh
#define calendarTypeh
#include "dateType.h
#include "extDateType.h
#include "dayType.h
class calendarType
public:
void setMonthint m;
void setYearint y;
int getMonth;
int getYear;
void printCalendar;
calendarType;
calendarTypeint m int y;
private:
dayType firstDayOfMonth;
void printTitle;
void printDates;
extDateType firstDate;
dayType firstDay;
;
#endif
dateType.h:
#ifndef dateTypeH
#define dateTypeH
class dateType
public:
void setDateint int, int;
void setMonthint;
void setDayint;
void setYearint;
void print const;
int numberOfDaysPassed;
int numberOfDaysLeft;
void incrementDateint nDays;
int getMonth const;
int getDay const;
int getYear const;
int getDaysInMonth;
bool isLeapYear;
dateTypeint int int ;
private:
int dMonth;
int dDay;
int dYear;
;
#endif
dayType.h:
#ifndef HdayType
#define HdayType
#include
using namespace std;
class dayType
public:
void print const;
string nextDay const;
string prevDay const;
void addDayint nDays;
void setDaystring d;
string getDay const;
dayType;
dayTypestring d;
private:
string weekDay;
;
#endif
extDateType.h:
#ifndef extDateTypeH
#define extDateTypeH
#include
#include "dateType.h
using namespace std;
class extDateType: public dateType
public:
void printLongDate;
void setDateint int, int;
void setMonthint m;
void printLongMonthYear;
extDateType;
extDateTypeint int, int;
private:
string month;
;
#endif
main.cpp:
#include
#include "dayType.h
#include "dateType.h
#include "extDateType.h
#include "calendarType.h
using namespace std;
int main
int month;
int year;
cout "Enter to indicate the calendar month to display: endl;
cin month;
cout "Enter the year: endl;
cin year;
test calendar object
calendarType calmonth year; Build claendarType object cal
cal.printCalendar; print object
return ;
extDateTypeImp.cpp:
#include
#include
#include "dateType.h
#include "extDateType.h
using namespace std;
void extDateType::printLongDate
cout month getDay getYear;
void extDateType::printLongMonthYear
cout month getYear;
void extDateType::setDateint m int d int y
static string months "January", "February", "March", "April",
May "June", "July", "August",
"September", "October", "November", "December";
dateType::setDatem d y;
month monthsm;
void extDateType::setMonthint m
static string months "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December";
dateType::setMonthm;
month monthsm;
extDateType::extDateType
month "January";
extDateType::extDateTypeint m int n int d
: dateTypemnd
static string months "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December";
month monthsm;
dayTypeImp.cpp:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
