-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathogrenci_kayit_sistemi.cpp
74 lines (66 loc) · 2.24 KB
/
ogrenci_kayit_sistemi.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
#include <iostream>
#include <vector>
using namespace std;
struct ogrenci{
int no;
string ad;
string soyad;
int yas;
};
int main(int argc, char** argv) {
vector<ogrenci>ogr;
int i = 0;
int secim;
int ogrSayisi;
do{
cout<<"Ogrenci sistemine hos geldiniz" << endl;
cout<<"Ogrenci eklemek icin : 1" << endl;
cout<<"Ogrenci silmek icin : 2" << endl;
cout<<"Ogrenci gostermek icin : 3" << endl;
cout<<"Ogrenci sisteminden cikmak icin : 4" << endl;
cin >> secim;
switch (secim) {
case 1:
ogr.push_back(ogrenci());
cout << "Ogrenci no: ";
cin >> ogr[ogrSayisi].no;
cin.ignore();
cout << "Ogrenci ad: ";
getline(cin, ogr[ogrSayisi].ad);
cout << "Ogrenci soyad: ";
getline(cin, ogr[ogrSayisi].soyad);
cout << "Ogrenci yas: ";
cin >> ogr[ogrSayisi].yas;
ogrSayisi++;
break;
case 2:
if (ogrSayisi > 0) {
ogr.pop_back();
ogrSayisi--;
cout << "Son eklenen ogrenci silindi." << endl;
} else {
cout << "Silinecek ogrenci bulunmamaktadýr." << endl;
}
break;
case 3:
if (ogrSayisi > 0) {
for (int i = 0; i < ogrSayisi; i++) {
cout << "Ogrenci No: " << ogr[i].no << endl;
cout << "Ogrenci Ad: " << ogr[i].ad << endl;
cout << "Ogrenci Soyad: " << ogr[i].soyad << endl;
cout << "Ogrenci Yas: " << ogr[i].yas << endl;
cout << "--------------------------" << endl;
}
} else {
cout << "Gosterilecek ögrenci bulunmamaktadir." << endl;
}
break;
case 4:
cout << "Ogrenci sisteminden cýkýldý." << endl;
break;
default:
cout << "Gecersiz secim. Lütfen tekrar deneyin." << endl;
}
}while(secim != 4);
return 0;
}