-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDate.h
46 lines (33 loc) · 850 Bytes
/
Date.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//A. Noel Cothren
//Program 5 - Alaskan Cruise
//File: Date.h
#ifndef _DATE_H
#define _DATE_H
#include <string>
using namespace std;
class Date
{
private:
static const int dayCount[12];
static const string monName[12];
int month{1}, day{1}, year{1900};
string description;
int dayOfYear{1};
bool bLeap{ false };
void CalcDayOfYear();
void DetermineLeapYear();
public:
Date();
Date(int m, int d, int y, string desc);
void SetDate(int m, int d, int y, string desc);
void SetDesc(string d){ description = d; }
string GetFormattedDate();
int GetDayOfYear()const {return dayOfYear;}
int GetYear()const { return year;}
int GetMonth()const { return month;}
int GetDay()const { return day;}
bool isLeapYear()const{ return bLeap; }
bool ValidateThisDate();
};
#endif