-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtarih.cpp
87 lines (72 loc) · 1.5 KB
/
tarih.cpp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include "tarih.h"
#include<iostream>
using namespace std;
Tarih::Tarih(int _yil)
{
yil = _yil;
}
int Tarih::getGün()const
{
return gün;
}
int Tarih::getAy()const
{
return ay;
}
int Tarih::getYýl()const
{
return yil;
}
void Tarih::setGün(int _gün)
{
gün = _gün;
}
void Tarih::setAy(int _ay)
{
ay = _ay;
}
void Tarih::setYýl(int _yil)
{
yil = _yil;
}
void Tarih::printdate()
{
cout << "dogum tarihi " << yil << endl;
}
// if (_ay > 0 && _ay <= BirYildakiAySayisi) // validate the month
// ay = _ay;
// else
// {
// ay = 1;
// invalid month set to 1
// cout << "Invalid month (" << _ay << ") set to 1.\n";
// }
// gün = _gün;
// yýl = _yýl;
//
// cout << "Date object constructor for date ";
// print();
// cout << endl;
//}
//void Tarih::print()const
//{
// cout << gün << "/" << ay << "/" << yýl << endl;
//
//}
//
//Tarih::~Tarih()
//{
// cout << "Date object destructor for date ";
// print();
// cout << endl;
//}
//int Tarih::GünKontrol(int testDay) const
//{
// static const int BirAydakiGünSayisi[12 + 1] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
// if (testDay > 0 && testDay <= BirAydakiGünSayisi[ay])
// return testDay; // February 29 check for leap year
// if (ay == 2 && testDay == 29 && (yýl % 400 == 0 || (yýl % 4 == 0 && yýl % 100 != 0)))
// return testDay;
// cout << "Invalid day (" << testDay << ") set to 1.\n";
// return 1; // leave object in consistent state if bad value
//}