forked from ASD-ADF/ASD_Task_2
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathClock.cpp
More file actions
70 lines (50 loc) · 970 Bytes
/
Clock.cpp
File metadata and controls
70 lines (50 loc) · 970 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
57
58
59
60
61
62
63
64
65
66
#include "Clock.h"
#include <iostream>
#include <conio.h>
using namespace std;
bool isValid(int &HH, int &MM, int &SS){
bool valid = false;
if((0<=HH<=23) and (0<=MM<=59) and (0<=SS<=59)) {
valid = true;
}
return valid;
};
clock makeClock(int HH, int MM, int SS){
clock c;
c.HH = HH;
c.HH = MM;
c.HH = SS;
return c;
};
hour getHour(clock c){
return c.HH;
};
minute getMinute(clock c){
return c.MM;
};
second getSecond(clock c){
return c.SS;
};
void setHour(clock c, int newHH){
c.HH = newHH;
cout<<c.HH;
};
void setMinute(clock c, int newMM){
c.MM = newMM;
cout<<c.MM;
};
void setSecond(clock c, int newSS){
c.SS = newSS;
cout<<c.SS;
};
bool isEqual(clock c1, clock c2){
bool value = false;
if((c1.HH=c2.HH) and (c1.MM==c2.MM) and (c1.SS==c2.SS)){
value = true;
}
return value;
};
clock addClock(clock c1, clock c2){
c1=c2;
return c2;
};