-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathogrenciOtomasyonSistemi.cpp
332 lines (261 loc) · 6.81 KB
/
ogrenciOtomasyonSistemi.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
#include <iostream>
#include <string>
#define MAX 150
#define MAX2 15
#define MAX3 10
using namespace std;
void gorevliMenu();
void anaMenu();
class Ogrenci {
public:
string ad, soyad;
int numara, vize, final;
double ortalama;
Ogrenci(){};
void yeniOgrenciKayit(string, string, int);
}ogrenci[MAX], ogrenci1[MAX3];
void Ogrenci :: yeniOgrenciKayit(string a, string s, int n){
ad = a;
soyad = s;
numara = n;
}
class Ogretmen {
public:
string ogretmenAd, ogretmenSoyad, sifre;
string ders;
int ogretmenNo;
void yeniOgretmenKayit(int, string, string, string, string);
void ogretmenMenu();
}ogretmen[MAX2];
void Ogretmen :: yeniOgretmenKayit(int n, string a, string s, string d, string pass){
ogretmenNo = n;
ogretmenAd = a;
ogretmenSoyad = s;
ders = d;
sifre = pass;
}
void Ogretmen :: ogretmenMenu(){
int secim, n;
static double toplam;
static int d = -1;
system("CLS");
cout << "- Öðretmen Not Sistemi -" << endl;
cout << endl;
cout << "1. Öðrenci Not Giriþi" << endl;
cout << "2. Sýnýf Not Ortalamasý" << endl;
cout << "3. Öðrenci Listesi" << endl;
cout << "4. Ana Menü" << endl;
cout << "> ";
cin >> secim;
switch(secim){
case 1:
system("CLS");
cout << "Notu girilecek öðrencinin numarasýný giriniz: ";
cin >> n;
for(int c = 0; c < 150; c++){
if(ogrenci[c].numara == n){
system("CLS");
cout << "Vize Notunu Giriniz: ";
cin >> ogrenci[c].vize;
cout << "Final Notunu Giriniz: ";
cin >> ogrenci[c].final;
cout << "Ýþlem Baþarýlý!" << endl;
d++;
ogrenci[c].ortalama = double(ogrenci[c].vize * 0.3 + ogrenci[c].final * 0.7);
ogrenci1[d] = ogrenci[c];
system("PAUSE");
ogretmenMenu();
} else {
cout << "Öðrenci Bulunamadý!!!" << endl;
system("PAUSE");
ogretmenMenu();
}
}
case 2:
system("CLS");
cout << "Sýnýfýn Not Ortalamasý: ";
if(d < 0){
cout << "Bu dersi alan öðrenci bulunmamakta!" << endl;
system("PAUSE");
ogretmenMenu();
} else {
for(int x = 0; x <= d; x++){
toplam += ogrenci1[x].ortalama;
cout << toplam / (d + 1) << endl;
system("PAUSE");
ogretmenMenu();
}
}
case 3:
system("CLS");
for(int x = 0; x <= d; x++){
for(int y = 0; y <= d; y++){
if(ogrenci1[x].numara == ogrenci[y].numara){
cout << "Ad : " << ogrenci1[x].ad << endl;
cout << "Soyad : " << ogrenci1[x].soyad << endl;
cout << "Numara : " << ogrenci1[x].numara << endl;
cout << "Ortalama: " << ogrenci1[x].ortalama << endl;
cout << endl;
}
}
}
system("PAUSE");
ogretmenMenu();
}
}
int main() {
setlocale(LC_ALL, "Turkish");
anaMenu();
system("PAUSE");
return 0;
}
void anaMenu(){
system("CLS");
int secim, b, number;
string sifre;
string kullaniciID, kullaniciSifre;
cout << "- Okul Otomasyonu -" << endl;
cout << endl;
cout << "1. Görevli Giriþi" << endl;
cout << "2. Öðretmen Giriþi" << endl;
cout << "3. Çýkýþ" << endl;
cout << "> ";
cin >> secim;
switch(secim){
case 1:
system("CLS");
cout << "Kullanýcý ID: ";
cin >> kullaniciID;
if(kullaniciID == "1"){
cout << "Þifre: ";
cin >> kullaniciSifre;
if(kullaniciSifre == "1"){
gorevliMenu();
} else {
cout << "Þifre Yanlýþ!!!" << endl;
system("PAUSE");
anaMenu();
}
} else {
cout << "Hatalý Giriþ!!!" << endl;
system("PAUSE");
anaMenu();
}
case 2:
system("CLS");
cout << "Numara Girin: ";
cin >> number;
for(b = 0; b < 15; b++){
if(ogretmen[b].ogretmenNo == number){
cout << "Þifre Doðru!" << endl;
system("PAUSE");
ogretmen[b].ogretmenMenu();
} else {
cout << "Þifre Yanlýþ!" << endl;
system("PAUSE");
anaMenu();
}
}
case 3:
exit(0);
default:
anaMenu();
}
}
void gorevliMenu(){
int secim, no, aranan;
static int numara = 0, i = -1, a = -1;
string ad, soyad, ders, sifre;
system("CLS");
cout << "- Okul Otomasyonu -" << endl;
cout << endl;
cout << "1. Yeni Öðrenci Kayýt" << endl;
cout << "2. Öðrenci Kayýt Sil" << endl;
cout << "3. Öðrenci Kayýt Listele" << endl;
cout << "4. Yeni Öðretmen Kayýt" << endl;
cout << "5. Öðretmen Kayýt Sil" << endl;
cout << "6. Öðretmen Listele" << endl;
cout << "7. Ana Menü" << endl;
cout << "> ";
cin >> secim;
switch(secim){
case 1:
system("CLS");
cout << "Öðrencinin Adýný Giriniz : ";
cin >> ad;
cout << "Öðrencinin Soyadýný Giriniz : ";
cin >> soyad;
cout << "Öðrencinin Numarasýný Giriniz: ";
cin >> no;
i++;
ogrenci[i].yeniOgrenciKayit(ad, soyad, no);
gorevliMenu();
case 2:
system("CLS");
cout << "Öðrencinin Numarasýný Giriniz: ";
cin >> aranan;
for(int j = 0; j <= i; j++){
if(ogrenci[j].numara == aranan){
for(int k = j; k < i; k++){
ogrenci[k] = ogrenci[k + 1];
cout << "Kayýt Baþarýyla Silindi!" << endl;
i--;
}
}
}
system("PAUSE");
gorevliMenu();
case 3:
system("CLS");
for(int j = 0; j <= i; j++){
cout << "Ad : " << ogrenci1[j].ad << endl;
cout << "Soyad : " << ogrenci1[j].soyad << endl;
cout << "Numara : " << ogrenci1[j].numara << endl;
cout << endl;
}
system("PAUSE");
gorevliMenu();
case 4:
system("CLS");
cout << "Öðretmenin Adýný Giriniz : ";
cin >> ad;
cout << "Öðretmenin Soydýný Giriniz : ";
cin >> soyad;
cout << "Öðretmenin Vereceði Dersi Giriniz : ";
cin >> ders;
cout << "Öðretmenin Kullanacaðý Þifreyi Giriniz: ";
cin >> sifre;
a++;
numara++;
ogretmen[a].yeniOgretmenKayit(numara, ad, soyad, ders, sifre);
gorevliMenu();
case 5:
system("CLS");
cout << "Öðretmenin Numarasýný Giriniz: ";
cin >> aranan;
for(int j = 0; j <= a; j++){
if(ogretmen[j].ogretmenNo == aranan){
for(int k = j; k < a; k++){
ogretmen[k] = ogretmen[k + 1];
cout << "Kayýt Baþarýyla Silindi!" << endl;
a--;
}
}
}
system("PAUSE");
gorevliMenu();
case 6:
system("CLS");
system("CLS");
for(int j = 0; j <= a; j++){
cout << "Ad : " << ogretmen[j].ogretmenAd << endl;
cout << "Soyad : " << ogretmen[j].ogretmenSoyad << endl;
cout << "Verdiði Ders: " << ogretmen[j].ders << endl;
cout << endl;
}
system("PAUSE");
gorevliMenu();
case 7:
anaMenu();
}
}