-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconsol.cpp
More file actions
56 lines (52 loc) · 1.11 KB
/
consol.cpp
File metadata and controls
56 lines (52 loc) · 1.11 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
#include <iostream>
#include "consol.h"
using namespace std;
consol::consol()
{
it = 0;
il = 0;
light[9]=200;
temp[9]=200;
}
void consol::inputLumen(int data)
{
int x=0;
if(light[9]==200){
light[il]=data;
il++;
}else{
for(int i=0;i<10;i++){
x+=light[i];
}
x/=10;
cout << "***************" << endl;
cout << "* Light: *" << endl;
cout << "* " << x << " *" << endl;
cout << "***************" << endl;
light[9]=200;
il = 0;
}
}
void consol::inputTemp(int data)
{
int x=0;
if(temp[9]==200){
temp[it]=data;
it++;
}else{
for(int i=0;i<10;i++){
x+=temp[i];
}
x/=10;
cout << "***************" << endl;
cout << "* Tempuratur: *" << endl;
if(x>9){
cout << "* " << x << " *" << endl;
}else{
cout << "* " << x << " *" << endl;
}
cout << "***************" << endl;
temp[9]=200;
it = 0;
}
}