-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
450 lines (346 loc) · 18.1 KB
/
Program.cs
File metadata and controls
450 lines (346 loc) · 18.1 KB
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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
using System.Linq.Expressions;
namespace CSharpAlistirma
{
internal class Program
{
static void Main(string[] args)
{
#region Yazdırma Komutları
// Console.WriteLine("***** Yemek Fiyatları:");
// Console.Write("1-Çorba:");
// Console.Write("50TL");
// Saçma ancak en azından WriteLine() ile Write() arasındaki farkı açıklar nitelikte :D
#endregion
#region String Değişkenler
// degisken_turu degisken_adi = deger; yada degisken-turu degisken_adi;
// camelCase. kabab-case.
// string name = "Muhammed";
// Console.WriteLine(name);
// string customerName;
// string customerSurname;
// string customerPhone;
// string customerEmail, customerDistrict, customerCity;
// customerName = "Ali";
// customerSurname = "Çınar";
// customerPhone = "+90 500 400 30 20";
// customerEmail = "ali@email.com";
// customerDistrict = "Kadıköy";
// customerCity = "İstanbul";
// Console.WriteLine("***** Rezervasyon Kartı *****");
// Console.WriteLine();
// Console.WriteLine("------------------------------------------------");
// Console.WriteLine("Müşteri: " + customerName + " " + customerSurname);
// Console.WriteLine("İletişim: " + customerPhone);
// Console.WriteLine("Email Adresi: " + customerEmail);
// Console.WriteLine("Adres: " + customerDistrict + "/" + customerCity);
// Console.WriteLine("------------------------------------------------");
// Console.WriteLine();
// customerName = "Ayşe";
// customerSurname = "Kaya";
// customerPhone = "+90 500 400 20 30";
// customerEmail = "ayse@email.com";
// customerDistrict = "Bağcılar";
// customerCity = "İstanbul";
// Console.WriteLine("------------------------------------------------");
// Console.WriteLine("Müşteri: " + customerName + " " + customerSurname);
// Console.WriteLine("İletişim: " + customerPhone);
// Console.WriteLine("Email Adresi: " + customerEmail);
// Console.WriteLine("Adres: " + customerDistrict + "/" + customerCity);
// Console.WriteLine("------------------------------------------------");
#endregion
#region Integer Değişkenler
// int number;
// number = 24;
// Console.WriteLine(number);
// int burgerPrice = 300;
// int cokePrice = 60;
// int waterPrice = 15;
// int friesPrice = 90;
// int pizzaPrice = 200;
// int lemonadePrice = 60;
// Console.WriteLine("***** RESTAURANT MENÜ *****");
// Console.WriteLine("------------------------------------------------");
// Console.WriteLine($"Burger: {burgerPrice} TL");
// Console.WriteLine($"Pizza: {pizzaPrice} TL");
// Console.WriteLine($"Patates K.: {friesPrice} TL");
// Console.WriteLine($"Su: {waterPrice} TL");
// Console.WriteLine($"Limonata: {lemonadePrice} TL");
// Console.WriteLine($"Kola: {cokePrice} TL");
// Console.WriteLine("-----------------------------------------------");
// Console.WriteLine();
// int burgerCount = 3;
// int pizzaCount = 3;
// int friesCount = 3;
// int waterCount = 1;
// int lemonadeCount = 0;
// int cokeCount = 0;
// int totalBurgerPrice = burgerPrice * burgerCount;
// int totalPizzaPrice = pizzaPrice * pizzaCount;
// int totalFriesPrice = friesPrice * friesCount;
// int totalWaterPrice = waterPrice * waterCount;
// int totalLemonadePrice = lemonadePrice * lemonadeCount;
// int totalCokePrice = cokePrice * cokeCount;
// int totalPrice = totalBurgerPrice + totalPizzaPrice + totalFriesPrice + totalWaterPrice + totalLemonadePrice + totalCokePrice;
// Console.WriteLine("***** Fatura *****");
// Console.WriteLine("***********************************************");
// Console.WriteLine($"Burger Fiyatı: {totalBurgerPrice} TL");
// Console.WriteLine($"Pizza Fiyatı: {totalPizzaPrice} TL");
// Console.WriteLine($"Patates K. Fiyatı: {totalFriesPrice} TL");
// Console.WriteLine($"Su Fiyatı: {totalWaterPrice} TL");
// Console.WriteLine($"Limonata Fiyatı: {totalLemonadePrice} TL");
// Console.WriteLine($"Kola Fiyatı: {totalCokePrice} TL");
// Console.WriteLine($"----- Toplam Ödenecek Tutar: {totalPrice} TL");
// Console.WriteLine("***********************************************");
#endregion
#region Double Değişkenler
// double number = 4.85;
// Console.WriteLine(number);
// double applePrice, orangePrice, strawberryPrice, potatoPrice, tomatoPrice;
// applePrice = 14.85;
// orangePrice = 20.95;
// strawberryPrice = 45;
// potatoPrice = 9.75;
// tomatoPrice = 6.50;
// double appleGram, orangeGram, strawberryGram, potatoGram, tomatoGram;
// appleGram = 1.245;
// orangeGram = 0.957;
// strawberryGram = 1.584;
// potatoGram = 2.758;
// tomatoGram = 2.452;
// double appleTotalPrice, orangeTotalPrice, strawberryTotalPrice, potatoTotalPrice, tomatoTotalPrice;
// appleTotalPrice = applePrice * appleGram;
// orangeTotalPrice = orangePrice * orangeGram;
// strawberryTotalPrice = strawberryPrice * strawberryGram;
// potatoTotalPrice = potatoPrice * potatoGram;
// tomatoTotalPrice = tomatoPrice * tomatoGram;
// double totalPrice = appleTotalPrice + orangeTotalPrice + strawberryTotalPrice + potatoTotalPrice + tomatoTotalPrice;
// Console.WriteLine("***** Fiyat Listesi *****");
// Console.WriteLine("------------------------------------------------");
// Console.WriteLine($"--- Elma Kg Fiyatı: {applePrice:0.00} TL");
// Console.WriteLine($"--- Portakal Kg Fiyatı: {orangePrice:0.00} TL");
// Console.WriteLine($"--- Çilek Kg Fiyatı: {strawberryPrice:0.00} TL");
// Console.WriteLine($"--- Patates Kg Fiyatı: {potatoPrice:0.00} TL");
// Console.WriteLine($"--- Domates Kg Fiyatı: {tomatoPrice:0.00} TL");
// Console.WriteLine("------------------------------------------------");
// Console.WriteLine();
// Console.WriteLine("***** Fatura *****");
// Console.WriteLine($"Satın Aldığınız Elma({appleGram} Gr) Fiyatı: {appleTotalPrice:0.00} TL");
// Console.WriteLine($"Satın Aldığınız Portakal({orangeGram} Gr) Fiyatı: {orangeTotalPrice:0.00} TL");
// Console.WriteLine($"Satın Aldığınız Çilek({strawberryGram} Gr) Fiyatı: {strawberryTotalPrice:0.00} TL");
// Console.WriteLine($"Satın Aldığınız Patates({potatoGram} Gr) Fiyatı: {potatoTotalPrice:0.00} TL");
// Console.WriteLine($"Satın Aldığınız Domates({tomatoGram} Gr) Fiyatı: {tomatoTotalPrice:0.00} TL");
// Console.WriteLine($"--- Toplam Ödeyeceğiniz Tutar: {totalPrice:0.00} TL");
#endregion
#region Char Değişkenler
//Şifreli Cümle: TOPLANTI SAAT 20.00'DE
// char symbol = 'a'; //Şimdilik bu kadar. not: char değişkeni " ile değil ' ile atanır
// Console.WriteLine(symbol);
#endregion
#region Klavyeden Veri Girişleri - String Değişkenler
// string passengerName, passengerSurname, passengerCity, passengerDistrict, passengerIdNumber, passengerAge;
// Console.WriteLine("***** CSharp Hava Yolları - Yolcu Kayıt *****");
// Console.WriteLine("*********************************************");
// Console.Write("Yolcu Adı: ");
// passengerName = Console.ReadLine()!;
// Console.Write("Yolcu Soyadı: ");
// passengerSurname = Console.ReadLine()!;
// Console.Write("Yolcu İkamet Ettiği Şehir: ");
// passengerCity = Console.ReadLine()!;
// Console.Write("Yolcu İkamet Ettiği İlçe: ");
// passengerDistrict = Console.ReadLine()!;
// Console.Write("Yolcu Kimlik No: ");
// passengerIdNumber = Console.ReadLine()!;
// Console.Write("Yolcu Yaşı: ");
// passengerAge = Console.ReadLine()!;
// Console.WriteLine("*********************************************");
// Console.WriteLine();
// Console.WriteLine("---------------- Yolcu Kartı ----------------");
// Console.WriteLine($"Yolcu Ad Soyad: {passengerName} {passengerSurname}");
// Console.WriteLine($"Yolcu İkametgah: {passengerDistrict}/{passengerCity}");
// Console.WriteLine($"Yolcu Kimlik Numarası: {passengerIdNumber}");
// Console.WriteLine($"Yolcu Yaşı: {passengerAge}");
// Console.WriteLine("---------------------------------------------");
#endregion
#region Klavyeden Tam Sayı Girişleri ve Dönüşümler
// int shoePrice, computerPrice, tvPrice, chairPrice;
// shoePrice = 1000;
// computerPrice = 20000;
// tvPrice = 12000;
// chairPrice = 5000;
// int shoeCount, computerCount, tvCount, chairCount;
// Console.WriteLine("-------------------------- Sipariş --------------------------");
// Console.Write("Lütfen satın almak istediğiniz ayakkabı sayısını giriniz: ");
// shoeCount = int.Parse(Console.ReadLine());
// Console.Write("Lütfen satın almak istediğiniz bilgisayar sayısını giriniz: ");
// computerCount = int.Parse(Console.ReadLine());
// Console.Write("Lütfen satın almak istediğiniz televizyon sayısını giriniz: ");
// tvCount = int.Parse(Console.ReadLine());
// Console.Write("Lütfen satın almak istediğiniz koltuk sayısını giriniz: ");
// chairCount = int.Parse(Console.ReadLine());
// Console.WriteLine("-------------------------------------------------------------");
// Console.WriteLine();
// int totalPrice = shoePrice * shoeCount + computerPrice * computerCount + tvPrice * tvCount + chairPrice * chairCount;
// Console.WriteLine("************************** Fatura **************************");
// Console.WriteLine($"Toplam Ödemeniz: {totalPrice} TL");
#endregion
#region Klavyeden Ondalıklı Sayı İşlemleri
// double exam1, exam2, exam3, result;
// Console.Write("1. Sınav notunuzu giriniz: ");
// exam1 = double.Parse(Console.ReadLine());
// Console.Write("2. Sınav notunuzu giriniz: ");
// exam2 = double.Parse(Console.ReadLine());
// Console.Write("3. Sınav notunuzu giriniz: ");
// exam3 = double.Parse(Console.ReadLine());
// result = (exam1 + exam2 + exam3) /3;
// Console.WriteLine("***** Sonuç *****");
// Console.WriteLine($"Ortalamanız: {result:0.00}");
#endregion
#region Klavyeden Karakter Girişleri
// Console.Write("Cinsiyet Seçiniz[E/K]: ");
// char gender = char.Parse(Console.ReadLine());
// Console.WriteLine($"Seçtiğiniz Cinsiyet: {gender}");
#endregion
#region If Else
// Console.Write("Lütfen şifreyi giriniz: ");
// string passwd = Console.ReadLine()!;
// if (passwd == "abcd")
// {
// Console.WriteLine("Şifre Doğru!");
// }
// else
// {
// Console.WriteLine("Şifre Yanlış...");
// }
// string country, capital;
// Console.Write("Lütfen Ülkeyi Giriniz: ");
// country = Console.ReadLine()!;
// Console.Write("Lütfen Başkenti Giriniz: ");
// capital = Console.ReadLine()!;
// if (country == "Türkiye" & capital == "Ankara")
// {
// Console.WriteLine("Veriler Doğrulandı!");
// }
// else
// {
// Console.WriteLine("Veriler Doğrulanamadı...");
// }
// double exam1, exam2, exam3, average;
// string result;
// Console.Write("Sınav 1: ");
// exam1 = double.Parse(Console.ReadLine()!);
// Console.Write("Sınav 2: ");
// exam2 = double.Parse(Console.ReadLine()!);
// Console.Write("Sınav 3: ");
// exam3 = double.Parse(Console.ReadLine()!);
// average = (exam1 + exam2 + exam3) / 3;
// if (average >= 0 & average < 45)
// {
// result = "Dersten kaldınız";
// Console.WriteLine($"Sınav Ortalamanız: {average:0.00}");
// Console.WriteLine($"Sınav Sonucunuz: {result}");
// }
// else if (average > 46 & average < 80)
// {
// result = "Dersten geçtiniz, ancak puanınız çok da iyi değil";
// Console.WriteLine($"Sınav Ortalamanız: {average:0.00}");
// Console.WriteLine($"Sınav Sonucunuz: {result}");
// }
// else if (average > 81 & average <= 100)
// {
// result = "Dersten yüksek bir puan ile geçtiniz";
// Console.WriteLine($"Sınav Ortalamanız: {average:0.00}");
// Console.WriteLine($"Sınav Sonucunuz: {result}");
// }
// else
// {
// result = "Sonuç yok, geçersiz değerler girilmiş";
// Console.WriteLine($"Sınav Ortalamanız: {average:0.00}");
// Console.WriteLine($"Sınav Sonucunuz: {result}");
// }
// Console.Write("Yaşadığınız Şehri Giriniz: ");
// string city = Console.ReadLine()!;
// if (city == "Söğüt" | city == "İstanbul" | city == "Bursa" | city == "Edirne")
// {
// Console.WriteLine("Yaşadığınız Şehir Osmanlı İmparatorluğunun Payitahtlarından Biriydi.");
// }
// else
// {
// Console.WriteLine("Yaşadığınız Şehir Osmanlı İmparatorluğunun Payitahtlarından Biri Değildi");
// }
// string username, passwd;
// Console.Write("Kullanıcı Adınızı Giriniz: ");
// username = Console.ReadLine()!;
// Console.Write("Şifrenizi Giriniz: ");
// passwd = Console.ReadLine()!;
// if (username == "admin" & passwd == "admin")
// {
// Console.WriteLine("Hoşgeldiniz Sayın Admin.");
// }
// else
// {
// Console.WriteLine($"Hoşgeldiniz, {username}.");
// }
#endregion
#region Mod İşlemleri
// int number = 26;
// int result = number % 5;
// Console.WriteLine(result);
// Console.Write("1. Sayıyı Giriniz: ");
// int number1 = int.Parse(Console.ReadLine()!);
// Console.Write("2. Sayıyı Giriniz: ");
// int number2 = int.Parse(Console.ReadLine());
// int result = number1 % number2;
// Console.WriteLine($"1. Sayının 2. Sayıya bölümünden kalanı: {result}");
// Console.Write("Lütfen Sayıyı Giriniz: ");
// int number = int.Parse(Console.ReadLine()!);
// if (number % 2 == 0)
// {
// Console.WriteLine("Girdiğiniz sayı çift");
// }
// else
// {
// Console.WriteLine("Girdiğiniz sayı tek");
// }
#endregion
#region Char Değişkenler ile Karar Yapıları
// Console.Write("Takımın sembolünü giriniz: ");
// char symbol = char.Parse(Console.ReadLine()!);
// if (symbol == 'g' | symbol == 'G')
// {
// Console.WriteLine("Galatasaray");
// }
// else if (symbol == 'f' | symbol == 'F')
// {
// Console.WriteLine("Fenerbahçe");
// }
// else if (symbol == 'b' | symbol == 'B')
// {
// Console.WriteLine("Beşiktaş");
// }
// else if (symbol == 't' | symbol == 'T')
// {
// Console.WriteLine("Trabzonspor");
// }
// else
// {
// Console.WriteLine("Girdiğiniz Takım Geçersiz");
// }
#endregion
#region Örnek Proje Uygulamaları
Console.WriteLine("**** C# Eğitim Kampı Restoran *****");
Console.WriteLine();
Console.WriteLine("-----------------------------------");
Console.WriteLine("1- Ana Yemekler");
Console.WriteLine("2- Çorbalar");
Console.WriteLine("3- Pizzalar");
Console.WriteLine("4- İçecekler");
Console.WriteLine("5- Tatlılar");
Console.WriteLine("-----------------------------------");
Console.WriteLine();
Console.Write("Lütfen Seçiminizi Yapınız: ");
string selection = Console.ReadLine()!;
#endregion
Console.ReadLine();
}
}
}