-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestupDate.cpp
77 lines (56 loc) · 2.02 KB
/
testupDate.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
// testupDate.cpp
// Author: Steven H Gold
// Program #4 due date: 11/5/2019
//
//
//
//
#include "upDate.h"
#include <iostream>
using namespace std;
int main()
{
upDate Bday;
upDate duedate(11,5,2019);
upDate today(duedate);
cout << endl;
cout << "Today is " << today << endl;
cout << "This program is due on " << duedate;
cout << endl;
cout << "(3)Right now there are "<<upDate::GetDateCount() << " upDate objects\n";
{
upDate d1, d2, d3, d4;
cout << "(7)Inside this block there are "<<upDate::GetDateCount() << " upDate objects\n";
}
cout << "(3)Outside the block there are "<<upDate::GetDateCount() << " upDate objects\n";
upDate dtemp(duedate);
dtemp++;
cout << "If you turn this assignment in on "<<dtemp<<" then is will be late.\n";
cout << "It is due on "<<--dtemp<<" so don't be late.\n";
cout << "One week from due date is "<<duedate+7<<endl;
cout << "One week from due date is "<<7+duedate<<endl;
cout << "One week earlier from due date is "<<duedate-7<<endl;
cout << "Your professor was born on "<<Bday<<" : ";
cout << "Master Gold is "<< duedate - Bday << " days old today\n";
cout << "Today is Julian date "<<duedate.julian()<<endl;;
cout << "Tomorrrow is Julian date "<<(++duedate).julian()<<endl;;
cout << "The very first Julian date was " << upDate(11,1,2018)-upDate(11,1,2018).julian()<<endl;
cout << "The very first Julian date was " << today - today.julian()<<endl;
upDate yesterday, tomorrow;
yesterday = today-1;
tomorrow = today+1;
cout << "Yesterday was "<<yesterday << endl;
cout << "Today is "<<today<<endl;
cout << "Tomorrow is "<<tomorrow<<endl;
cout << "Today is ";
cout << ((today>tomorrow)?"greater than":"not greater than");
cout << " than tomorrow\n";
cout << "Today is ";
cout << ((today<tomorrow)?"less than":"not less than");
cout << " than tomorrow\n";
cout << "Today is ";
cout << ((today==tomorrow)?"equal to":"not equal to");
cout << " tomorrow\n";
getchar();
return 0;
}