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 calendarType_h
#define calendarType_h
#include "dateType.h"
#include "extDateType.h"
#include "dayType.h"
class calendarType
{
public:
void setMonth(int m);
void setYear(int y);
int getMonth();
int getYear();
void printCalendar();
calendarType();
calendarType(int m, int y);
private:
dayType firstDayOfMonth();
void printTitle();
void printDates();
extDateType firstDate;
dayType firstDay;
};
#endif
dateType.h:
#ifndef dateType_H
#define dateType_H
class dateType
{
public:
void setDate(int, int, int);
void setMonth(int);
void setDay(int);
void setYear(int);
void print() const;
int numberOfDaysPassed();
int numberOfDaysLeft();
void incrementDate(int nDays);
int getMonth() const;
int getDay() const;
int getYear() const;
int getDaysInMonth();
bool isLeapYear();
dateType(int =1, int =1, int =1900);
private:
int dMonth;
int dDay;
int dYear;
};
#endif
dayType.h:
#ifndef H_dayType
#define H_dayType
#include
using namespace std;
class dayType
{
public:
void print() const;
string nextDay() const;
string prevDay() const;
void addDay(int nDays);
void setDay(string d);
string getDay() const;
dayType();
dayType(string d);
private:
string weekDay;
};
#endif
extDateType.h:
#ifndef extDateType_H
#define extDateType_H
#include
#include "dateType.h"
using namespace std;
class extDateType: public dateType
{
public:
void printLongDate();
void setDate(int, int, int);
void setMonth(int m);
void printLongMonthYear();
extDateType();
extDateType(int, 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 1-12 to indicate the calendar month to display: "<< endl;
cin >> month;
cout << "Enter the year: "<< endl;
cin >> year;
//test calendar object
calendarType cal(month, year); // Build claendarType object cal
cal.printCalendar(); //print object
return 0;
}
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::setDate(int m, int d, int y)
{
static string months[13]={"", "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"};
dateType::setDate(m, d, y);
month = months[m];
}
void extDateType::setMonth(int m)
{
static string months[13]={"", "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"};
dateType::setMonth(m);
month = months[m];
}
extDateType::extDateType()
{
month = "January";
}
extDateType::extDateType(int m, int n, int d)
: dateType(m,n,d)
{
static string months[13]={"", "January", "February", "March", "April",
"May", "June", "July", "August",
"September", "October", "November", "December"};
month = months[m];
}
dayTypeImp.cpp:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!