-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotoparkOtomasyonu.cpp
197 lines (153 loc) · 3.43 KB
/
otoparkOtomasyonu.cpp
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#include <iostream>
#include <string>
#include <conio.h>
#include <cmath>
#include <ctime>
#define MAX 100
using namespace std;
class Arac {
public:
string aracPlaka;
string kisiAd, kisiSoyad, kisiTel;
time_t giris;
}araba[MAX];
class Otopark {
public:
string gorevliAdi, gorevliSifre;
int i, gelir;
Otopark(string adi, string sifre){
gorevliAdi = adi;
gorevliSifre = sifre;
gelir = 0;
i = -1;
}
void menu(){
int secim;
cout << "- TATAR OTOPARK -" << endl << endl;
cout << "1. Yeni Araç Giriþ" << endl;
cout << "2. Araç Çýkýþ" << endl;
cout << "3. Araçlarý Listele" << endl;
cout << "4. Rapor" << endl;
cout << "5. Çýkýþ" << endl;
cout << "> ";
cin >> secim;
switch(secim){
case 1:
yeniAracGiris();
break;
case 2:
aracCikis();
break;
case 3:
aracListele();
break;
case 4:
rapor();
break;
case 5:
exit(0);
break;
default:
cout << "Hatalý Seçim!!!" << endl;
system("PAUSE");
system("CLS");
menu();
break;
}
}
void yeniAracGiris(){
system("CLS");
i++;
cout << "Aracýn Sahibinin Adý : ";
cin >> araba[i].kisiAd;
cout << "Aracýn Sahibinin Soyadý : ";
cin >> araba[i].kisiSoyad;
cout << "Aracýn Sahibinin Telefon Numarasý: ";
cin >> araba[i].kisiTel;
cout << "Aracýn Plakasý : ";
cin >> araba[i].aracPlaka;
cout << "Ýþlem Baþarýlý!" << endl;
time_t($araba[i].giris);
system("PAUSE");
system("CLS");
menu();
}
void aracCikis(){
system("CLS");
bool buldu = false;
int j = 0, k, saat;
double sure;
time_t cikis;
string plaka;
time_t($cikis);
cout << "Araç Plakasýný Girin: ";
cin >> plaka;
while(j <= 1){
if(araba[j].aracPlaka == plaka){
sure = difftime(cikis, araba[j].giris);
for(k = j; k <= i; k++){
araba[k] = araba[k + 1];
}
i--;
buldu = true;
break;
}
j++;
}
if(buldu == true){
cout << "Plaka Bulunamadý!!!" << endl;
system("PAUSE");
system("CLS");
menu();
}
sure = sure / 3600;
saat = ceil(sure);
cout << "Ücret: " << saat * 5 << "TL" << endl;
gelir += saat * 5;
system("PAUSE");
system("CLS");
menu();
}
void aracListele(){
system("CLS");
for(int j = 0; j <= i; j++){
cout << araba[j].aracPlaka << endl;
}
system("PAUSE");
system("CLS");
menu();
}
void rapor(){
system("CLS");
cout << "Anlýk Gelir: " << gelir << "TL" << endl;
system("PAUSE");
system("CLS");
menu();
}
};
int main() {
setlocale(LC_ALL, "Turkish");
Otopark calisan("dogantatarjr", "dogan2008");
string ad, sifre;
int i = 0;
cout << "- TATAR OTOPARK -" << endl;
while(1){
cout << "Kullanýcý Adý Girin: ";
cin >> ad;
cout << "Þifre Girin : ";
cin >> sifre;
if(calisan.gorevliAdi == ad && calisan.gorevliSifre == sifre){
cout << "Giriþ Baþarýlý!" << endl;
system("PAUSE");
break;
} else {
cout << "Tekrar Deneyin!!!" << endl;
system("PAUSE");
system("CLS");
}
}
system("CLS");
calisan.menu();
system("PAUSE");
return 0;
}