-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeladatok.cs
87 lines (79 loc) · 3.25 KB
/
Feladatok.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
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static e_inf_16okt_cs.Fuggvenyek;
namespace e_inf_16okt_cs
{
internal class Feladatok
{
internal static void Feladat1()
{
Console.WriteLine("1. feladat:");
Console.WriteLine("A feladat végrehajtva.");
Console.WriteLine();
Console.WriteLine();
}
internal static void Feladat2(out List<HIVAS> lst, String fileName)
{
Console.WriteLine("2. feladat:");
Beolvasas(fileName, out lst);
Console.WriteLine("A feladat végrehajtva.");
Console.WriteLine();
Console.WriteLine();
}
internal static void Feladat3(List<HIVAS> lst)
{
Console.WriteLine("3. feladat:");
for (int i = 0; i <= 12; i++)
{
Console.WriteLine((i + 6) + " óra: " + DarabOraban(lst, new IDO(i + 6, 0, 0).ToSeconds(), new IDO(i + 6, 59, 59).ToSeconds()) + " hívás");
}
Console.WriteLine("A feladat végrehajtva.");
Console.WriteLine();
Console.WriteLine();
}
internal static void Feladat4(List<HIVAS> lst)
{
Console.WriteLine("4. feladat:");
Console.WriteLine("A leghosszabb ideig vonalban lévő hívó a " + MaxKivalasztas(lst).sorszam + ". sorban szerepel,");
Console.WriteLine("a hívásának hossza: " + MaxKivalasztas(lst).hossz + " másodperc.");
Console.WriteLine();
Console.WriteLine();
}
internal static void Feladat5(List<HIVAS> lst)
{
Console.WriteLine("5. feladat:");
Console.Write("Adj meg egy időpontot (ó p mp formában): ");
String idopont = Console.ReadLine();
IDOPONTADAT ia = IdopontAdatok(lst, new IDO(idopont.Replace(' ', ':')));
if (ia.varakozok == -1) Console.WriteLine("");
else Console.WriteLine("Jelenleg " + ia.varakozok + " várakozó van, éppen a " + ia.vonalban + ". hívó van vonalban.");
Console.WriteLine();
Console.WriteLine();
}
internal static void Feladat6(List<HIVAS> lst)
{
Console.WriteLine("6. feladat:");
TELEFONALOADATOK adat = UtolsoTelefonalo(lst);
Console.WriteLine("Az utolsó telefonáló adatai a " + adat.hivasinfo + ". sorban vannak, a sorra kerülésig " + adat.varakozasi_ido + " másodpercet várt.");
Console.WriteLine();
Console.WriteLine();
}
internal static void Feladat7(List<HIVAS> lst, String fileName)
{
Console.WriteLine("7. feladat:");
List<HIVASKI> ki = TelefonaloAdatok(lst);
List<String> out_datas = new List<String>();
for (int i = 0; i < ki.Count; i++)
{
out_datas.Add(ki[i].id + " " + ki[i].hivas.kezdo.GetTime().Replace(':', ' ') + " " + ki[i].hivas.veg.GetTime().Replace(':', ' '));
}
File.WriteAllLines(fileName, out_datas);
Console.WriteLine("A fájlba írás sikeresen befejeződött");
Console.WriteLine();
}
}
}