forked from ASD-ADF/ASD_Task_2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClock.cpp
More file actions
69 lines (64 loc) · 1.17 KB
/
Clock.cpp
File metadata and controls
69 lines (64 loc) · 1.17 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include "heads.h"
using namespace std;
bool IsValid(int jj,int mm, int ss)
{
if ((jj>=0)&&(jj<=23)&&(mm>=0)&&(mm<=59)&&(ss>=0)&&(ss<=59)){
return true;
}
else{
return false;
}
}
clock buatjam(int h,int m,int s)
{
clock wkt;
wkt.jam=h;
wkt.meni=m;
wkt.det=s;
return wkt;
}
int ambiljam(clock jams){
return jams.jam;
}
int ambilmenit(clock menit){
return menit.meni;
}
int ambildetik(clock detik){
return detik.det;
}
void setjam(int jamset)
{
clock jaman;
jaman.jam=jamset;
cout << "Jam diatur jadi : " << jaman.jam << endl;
}
void setmen(int menset)
{
clock menan;
menan.meni=menset;
cout << "menit diatur jadi : "<< menan.meni << endl;
}
void setdet(int detset)
{
clock detan;
detan.det=detset;
cout << "detik diatur jadi : "<< detan.det << endl;
}
bool Equal (clock equ1, clock equ2)
{
bool val;
if (equ1.jam == equ2.jam && equ1.meni == equ2.meni && equ1.det == equ2.det)
{
val=true;
}
else
{
val=false;
}
return val;
}
void Print (clock pit)
{
cout << pit.jam << " : " << pit.meni << " : " << pit.det << endl;
}