-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
314 lines (240 loc) · 12.2 KB
/
Form1.cs
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
namespace _02_iF_ELse
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnStudent_Click(object sender, EventArgs e)
{
double your_balance = Convert.ToDouble(textYour_Balance.Text);
double number_of_goes = Convert.ToDouble(textNumber_Of_Goes.Text);
double student_fee = 2.67;
if (your_balance >= 2.67)
{
if (number_of_goes == 1)
{
double available_balance = your_balance - student_fee;
double balance = student_fee - 1.73;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes == 2)
{
double available_balance = your_balance - student_fee;
double balance = student_fee - 1.88;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes == 3)
{
double available_balance = your_balance - student_fee;
double balance = student_fee - 2.19;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 4 && number_of_goes <= 9)
{
double available_balance = your_balance - student_fee;
double balance = student_fee - 2.50;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes > 9)
{
double available_balance = your_balance - student_fee;
MessageBox.Show($"You are not entitled to a balance refund." +
$"\nYour remaining balanceb : {available_balance}TL");
}
}
else
{
MessageBox.Show("Your balance is insufficient.");
}
}
private void btnNormal_Click(object sender, EventArgs e)
{
double your_balance = Convert.ToDouble(textYour_Balance.Text);
double number_of_goes = Convert.ToDouble(textNumber_Of_Goes.Text);
double normal_fee = 8.13;
if (your_balance >= 8.13)
{
if (number_of_goes == 1)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 3.92;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes == 2)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 4.69;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes == 3)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 5.48;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 4 && number_of_goes <= 9)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 6.26;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 10 && number_of_goes <= 15)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 6.88;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 16 && number_of_goes <= 21)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 7.19;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 22 && number_of_goes <= 27)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 7.43;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 28 && number_of_goes <= 33)
{
double available_balance = your_balance - normal_fee;
double balance = normal_fee - 7.59;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes > 34)
{
double available_balance = your_balance - normal_fee;
MessageBox.Show($"You are not entitled to a balance refund." +
$"\nYour remaining balanceb : {available_balance} TL");
}
}
else
{
MessageBox.Show("Your balance is insufficient.");
}
}
private void btnSocial_Click(object sender, EventArgs e)
{
double your_balance = Convert.ToDouble(textYour_Balance.Text);
double number_of_goes = Convert.ToDouble(textNumber_Of_Goes.Text);
double social_fee = 3.92;
if (your_balance >= 3.92)
{
if (number_of_goes == 1)
{
double available_balance = your_balance - social_fee;
double balance = social_fee - 2.42;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes == 2)
{
double available_balance = your_balance - social_fee;
double balance = social_fee - 2.90;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes == 3)
{
double available_balance = your_balance - social_fee;
double balance = social_fee - 3.36;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 4 && number_of_goes <= 9)
{
double available_balance = your_balance - social_fee;
double balance = social_fee - 3.92;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 10 && number_of_goes <= 15)
{
double available_balance = your_balance - social_fee;
double balance = social_fee - 3.98;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes >= 16 && number_of_goes <= 21)
{
double available_balance = your_balance - social_fee;
double balance = social_fee - 4.23;
double balance2 = balance + available_balance;
MessageBox.Show($"Refunded amount : {Math.Round(balance, 2)}TL" +
$"\nYour remaining balanceb : {Math.Round(balance2, 2)} TL ");
}
else if (number_of_goes > 22)
{
double available_balance = your_balance - social_fee;
MessageBox.Show($"You are not entitled to a balance refund." +
$"\nYour remaining balanceb : {available_balance}TL");
}
}
else
{
MessageBox.Show("Your balance is insufficient.");
}
}
private void btnNot_Click(object sender, EventArgs e)
{
double vize = Convert.ToDouble(textVize.Text);
double final = Convert.ToDouble(textFinal.Text);
double odev = Convert.ToDouble(textOdev.Text);
double ortalama = (vize / 100 * 30) + (final / 100 * 60) + (odev / 100 * 10);
string harfnotu1 = "CC", harfnotu2 = "CB", harfnotu3 = "BB", harfnotu4 = "BA", harfnotu5 = "AA";
if (vize >= 0 && final >= 0 && odev >= 0)
{
if (ortalama >= 0 && ortalama < 40)
MessageBox.Show($"Ortalama:{ortalama} FF ");
else if (ortalama >= 40 && ortalama < 50)
{ MessageBox.Show($"Ortalama:{ortalama}\nHarf Notu: {harfnotu1}"); }
else if (ortalama >= 50 && ortalama < 65)
{ MessageBox.Show($"Ortalama:{ortalama}\nHarf Notu: {harfnotu2}"); }
else if (ortalama >= 65 && ortalama < 75)
{ MessageBox.Show($"Ortalama:{ortalama}\nHarf Notu: {harfnotu3}"); }
else if (ortalama >= 75 && ortalama < 85)
{ MessageBox.Show($"Ortalama:{ortalama}\nHarf Notu: {harfnotu4}"); }
else if (ortalama >= 85 && ortalama <= 100)
{ MessageBox.Show($"Ortalama:{ortalama}\nHarf Notu: {harfnotu5}"); }
else
{ MessageBox.Show("100'den büyük değer giremezsiniz"); }
}
else
{
MessageBox.Show("0'dan küçük sayı giremezsiniz!");
}
}
}
}