-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYUKSEKLISANSLISANSOTOMASYONU.java
221 lines (177 loc) · 5.86 KB
/
YUKSEKLISANSLISANSOTOMASYONU.java
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
// CLASS MAIN
public class Main {
public static void main(String[] args)
{
Ogrenci ogr = new Ogrenci("Hediye", "Orhan");
YuksekLisansOgrencisi yogr = new YuksekLisansOgrencisi("Hediye", "Orhan", "Tez", 65);
LisansOgrencisi logr = new LisansOgrencisi("Hediye", "Orhan", 2, 90, 75);
Ogrenci ogr1 = new Ogrenci("Elif", "Orhan");
YuksekLisansOgrencisi yogr1 = new YuksekLisansOgrencisi("Elif", "Orhan", "Ders", 85);
LisansOgrencisi logr1 = new LisansOgrencisi("Elif", "Orhan", 3, 40, 85);
System.out.println("\n---------------------------\n");
System.out.println("\n -- Ogrenci -- \n");
ogr.bilgileriYazdir();
ogr1.bilgileriYazdir();
System.out.println("\n---------------------------\n");
System.out.println("\n -- YuksekLisansOgrencisi -- \n");
yogr.HarfHesapla();
System.out.println(" ");
yogr.MezuniyetYiliHesapla();
System.out.println(" ");
yogr.bilgileriYazdir();
yogr1.HarfHesapla();
System.out.println(" ");
yogr1.MezuniyetYiliHesapla();
System.out.println(" ");
yogr1.bilgileriYazdir();
System.out.println("\n---------------------------\n");
System.out.println("\n -- LisansOgrencisi -- \n");
logr.GecmeNotuHesapla();
System.out.println(" ");
logr.MezuniyetYiliHesapla();
System.out.println(" ");
logr.bilgileriYazdir();
logr1.GecmeNotuHesapla();
System.out.println(" ");
logr1.MezuniyetYiliHesapla();
System.out.println(" ");
logr1.bilgileriYazdir();
}
}
// CLASS OGRENCI
public class Ogrenci {
private int id;
private static int sayac = 0;
public String ad;
public String soyad;
public Ogrenci(String ad, String soyad) {
super();
this.id = sayac++;
this.ad = ad;
this.soyad = soyad;
}
public void bilgileriYazdir() {
System.out.println("Ogrenci id : " + id);
System.out.println("Ogrenci ad : " + ad);
System.out.println("Ogrenci soyad : " + soyad);
}
}
// CLASS YUKSEKLISANSOGRENCISI
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Date;
public class YuksekLisansOgrencisi extends Ogrenci {
private int id;
private static int sayac = 0;
public String asama;
public int final_notu;
public YuksekLisansOgrencisi(String ad, String soyad, String asama, int final_notu) {
super(ad, soyad);
this.id = sayac++;
this.asama = asama;
this.final_notu = final_notu;
}
@Override
public void bilgileriYazdir() {
System.out.println("Ogrenci id : " + id);
System.out.println("Ogrenci ad : " + ad);
System.out.println("Ogrenci soyad : " + soyad);
System.out.println("Ogrenci asama : " + asama);
System.out.println("Ogrenci final : " + final_notu);
}
public void HarfHesapla()
{
if (final_notu >= 90) {
System.out.println("Harf notu AA");
}
else if (final_notu >= 85) {
System.out.println("Harf notu BA");
}
else if (final_notu >= 80) {
System.out.println("Harf notu BB");
}
else if (final_notu >= 75) {
System.out.println("Harf notu CB");
}
else if (final_notu >= 70) {
System.out.println("Harf notu CC");
}
else if (final_notu >= 65) {
System.out.println("Harf notu DC");
}
else if (final_notu >= 60) {
System.out.println("Harf notu DD");
}
else if (final_notu >= 55) {
System.out.println("Harf notu FD");
}
else {
System.out.println("Harf notu FF. Kaldiniz !!");
}
}
public void MezuniyetYiliHesapla()
{
int yil = 0;
Calendar takvim = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
//System.out.println("YİL : " + sdf.format(takvim.getTime()));
if(asama.equals("Tez"))
{
yil = 0;
}
else
yil = 1;
System.out.println("Ogrenci id : " + id);
System.out.println("Ogrenci ad : " + ad);
System.out.println("Ogrenci soyad : " + soyad);
System.out.println("Yaklasik mezuniyet tarihi : " + (Integer.valueOf(sdf.format(takvim.getTime())) + yil));
}
}
// CLASS LISANSOGRENCISI
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class LisansOgrencisi extends Ogrenci {
private int id;
private static int sayac = 0;
public int sinif;
public int vize;
public int final_notu;
public LisansOgrencisi(String ad, String soyad, int sinif, int vize, int final_notu) {
super(ad, soyad);
this.id = sayac++;
this.sinif = sinif;
this.vize = vize;
this.final_notu = final_notu;
}
@Override
public void bilgileriYazdir() {
System.out.println("Ogrenci id : " + id);
System.out.println("Ogrenci ad : " + ad);
System.out.println("Ogrenci soyad : " + soyad);
System.out.println("Ogrenci sinif : " + sinif);
System.out.println("Ogrenci vize : " + vize);
System.out.println("Ogrenci final : " + final_notu);
}
public void GecmeNotuHesapla() {
double gn;
gn = (vize * 0.4) + (final_notu * 0.6);
System.out.println("Ogrenci id : " + id);
System.out.println("Ogrenci ad : " + ad);
System.out.println("Ogrenci soyad : " + soyad);
System.out.println("Ogrenci gecme notu : " + gn);
}
public void MezuniyetYiliHesapla() {
Calendar takvim = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
//System.out.println("YİL : " + sdf.format(takvim.getTime()));
int yil = Integer.valueOf(sdf.format(takvim.getTime()));
int kalan = 4 - sinif;
System.out.println("Ogrenci id : " + id);
System.out.println("Ogrenci ad : " + ad);
System.out.println("Ogrenci soyad : " + soyad);
System.out.println("Ogrencinin mezuniyet yili : " + (yil + kalan));
}
}