-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdayTomorrow.cpp
More file actions
52 lines (42 loc) · 1.21 KB
/
dayTomorrow.cpp
File metadata and controls
52 lines (42 loc) · 1.21 KB
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
//=================================================
//dayTomorrow.cpp
//Code reports the date following the input date,in
//day month year fromat. Loops until invalid input
//is provided
//==================================================
#include<iostream>
using namespace std;
void tomorrow(int day,int month,int year,
int & dayNext,int & monthNext,int & yearNext);
//================>>main<<===========================
int main()
{
//get initial input
cout<< "Input day month year (seperated by spaces) :>";
int day;
cin>>day;
int month;
cin>>month;
int year;
cin>>year;
while(not cin.fail())
{
//Figure out next day
int dayNext;
int monthNext;
int yearNext;
tomorrow(day,month,year,dayNext,monthNext,yearNext);
//Show it to user
cout<< " After "<<day<<" "<<month<<" "<<year;
cout<< " there follows the glorious day ";
cout<< dayNext <<" "<<monthNext<<" "<<yearNext;
cout<<endl<<endl;
//get input for next go around
cout<< " Input day month year (seperated by spaces) :> ";
cin>>day;
cin>>month;
cin>>year;
}
cout<< "Thanks for the interest in the calendar."<<endl;
return 0;
}