-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIslemler.cs
42 lines (38 loc) · 1.03 KB
/
Islemler.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
using System;
namespace ucgen_cizme;
struct Islemler
{
internal bool GirdiAl()
{
try
{
int uzunluk = Convert.ToInt32(Console.ReadLine());
if (uzunluk < 1)
throw new Exception();
new Ucgen(uzunluk); // Üçgen çiziliyor
return true;
}
catch (Exception)
{
Console.WriteLine("Üçgenin uzunluğu için pozitif bir tam sayı girmeniz gerekli!");
System.Threading.Thread.Sleep(2000);
return false;
}
}
internal int TekrarMi()
{
Soru:
Console.WriteLine("Başka bir üçgen çizdirmek ister misiniz? [E] Evet / [H] Hayır");
switch (Console.ReadLine().ToLower())
{
case "e":
return 1;
case "h":
return 0;
default:
Console.WriteLine("Hatalı seçim yaptınız! Lütfen tekrar deneyin!");
Console.WriteLine();
goto Soru;
}
}
}