-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTask1_main.cpp
More file actions
56 lines (44 loc) · 980 Bytes
/
Task1_main.cpp
File metadata and controls
56 lines (44 loc) · 980 Bytes
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
/**
* @file Task1_main.cpp
*
* @brief This code implements creates array of Time objects
* and add minutes seperately.
*
* @author Saif Ullah Ijaz
*
*/
// SYSTEM INCLUDES
#include <iostream>
using namespace std;
// LOCAL INCLUDES
#include "time.h"
// function main begins program execution
void main() {
Time::sSetDefaultTime(15, 45, 0);
Time t[4] = { Time(12,30),Time(14,50),Time(23,59) };
t[0].Display24();
t[0].Display12();
cout << "Adding 15 minutes" << endl;
t[0].AddMinute(15);
t[0].Display24();
t[0].Display12();
cout << endl;
t[1].Display24();
t[1].Display12();
cout << "Adding 20 minutes" << endl;
t[1].AddMinute(20);
t[1].Display24();
t[1].Display12();
cout << endl;
t[2].Display24();
t[2].Display12();
cout << "Adding 2 minutes" << endl;
t[2].AddMinute(2);
t[2].Display24();
t[2].Display12();
cout << endl;
t[3].Display24();
t[3].Display12();
system("pause");
}
// end main