Using Include Dateorigcpp File Starting Point Restructure Code Main Function Resides File Q37078953

Using the include DateOrig.cpp file as a starting point,restructure the code so that:

  1. The main function resides in a file called DateTest.cpp.
  2. Separate your date class so that the declarations reside in afile called Date.h.
  3. Put the definitions (functions bodies) in a file calledDate.cpp.
  4. Make sure that the Date class is protected against multipleinclusions.

#include <iostream>

#include “DateUtil.h”

using namespace std;

class Date

{

private:

int day;

int month;

int year;

public:

Date() {getCurrentDate(day,month,year);}

Date(int d, int m, int y):day(d),month(m),year(y) {}

int getDay() const { return day; } ;

void setDay(int d) {day = d;}

int getMonth() const {return month;}

void setMonth(int m) {month = m;}

int getYear() const { return year; }

void setYear(int y) { year = y; }

void displayDate()

{

cout

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.