added yesterday's work
This commit is contained in:
BIN
20240905/Fizetes/.vs/Fizetes/v16/.suo
Normal file
BIN
20240905/Fizetes/.vs/Fizetes/v16/.suo
Normal file
Binary file not shown.
25
20240905/Fizetes/Fizetes.sln
Normal file
25
20240905/Fizetes/Fizetes.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.34729.46
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fizetes", "Fizetes\Fizetes.csproj", "{2927D585-DD8D-4010-94C3-F73C3F228ACD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2927D585-DD8D-4010-94C3-F73C3F228ACD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2927D585-DD8D-4010-94C3-F73C3F228ACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2927D585-DD8D-4010-94C3-F73C3F228ACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2927D585-DD8D-4010-94C3-F73C3F228ACD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2DB21D78-A314-40EB-8FFC-EEFCB70E4C36}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
6
20240905/Fizetes/Fizetes/App.config
Normal file
6
20240905/Fizetes/Fizetes/App.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
53
20240905/Fizetes/Fizetes/Fizetes.csproj
Normal file
53
20240905/Fizetes/Fizetes/Fizetes.csproj
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{2927D585-DD8D-4010-94C3-F73C3F228ACD}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Fizetes</RootNamespace>
|
||||
<AssemblyName>Fizetes</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
177
20240905/Fizetes/Fizetes/Program.cs
Normal file
177
20240905/Fizetes/Fizetes/Program.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
|
||||
namespace Fizetes
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
DataRead();
|
||||
Feladat3();
|
||||
Feladat4();
|
||||
Feladat5();
|
||||
Feladat6();
|
||||
Feladat7();
|
||||
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
public static void Feladat3()
|
||||
{
|
||||
Console.WriteLine(Data.munkasok.Count);
|
||||
}
|
||||
|
||||
public static void Feladat4()
|
||||
{
|
||||
int atlagber = AtlagBer();
|
||||
Console.WriteLine($"A 2020-as átlagbérek: {atlagber} ezer Forint");
|
||||
}
|
||||
|
||||
public static int AtlagBer()
|
||||
{
|
||||
int dolgozoknum = Data.munkasok.Count;
|
||||
int dolgozokberSZUM = DolgozokBerSZUM();
|
||||
|
||||
|
||||
return (dolgozokberSZUM / dolgozoknum) / 1000;
|
||||
}
|
||||
|
||||
public static int DolgozokBerSZUM()
|
||||
{
|
||||
int szum = 0;
|
||||
foreach (var item in Data.munkasok)
|
||||
{
|
||||
szum += item.Ber;
|
||||
}
|
||||
return szum;
|
||||
}
|
||||
|
||||
public static void Feladat5()
|
||||
{
|
||||
Console.WriteLine("Kérem a részleg nevét: ");
|
||||
}
|
||||
|
||||
public static void Feladat6()
|
||||
{
|
||||
string reszleg = Console.ReadLine();
|
||||
int legjobbankereso_index = LegjobbanKereso_index(reszleg);
|
||||
if (legjobbankereso_index == -1)
|
||||
{
|
||||
Console.WriteLine("A megadott részleg nem létezik a cégnél!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Név: {Data.munkasok[legjobbankereso_index].Nev}");
|
||||
Console.WriteLine($"Nem: {Data.munkasok[legjobbankereso_index].Nem}");
|
||||
Console.WriteLine($"Belépés: {Data.munkasok[legjobbankereso_index].Belepes}");
|
||||
Console.WriteLine($"Bér: {Data.munkasok[legjobbankereso_index].Ber}");
|
||||
}
|
||||
}
|
||||
|
||||
public static int LegjobbanKereso_index(string reszleg)
|
||||
{
|
||||
int legnagyobbBer = 0;
|
||||
int legnagyobb_index = -1;
|
||||
for (int i = 0; i < Data.munkasok.Count; i++)
|
||||
{
|
||||
if (Data.munkasok[i].Ber > legnagyobbBer && Data.munkasok[i].Reszleg == reszleg)
|
||||
{
|
||||
legnagyobbBer = Data.munkasok[i].Ber;
|
||||
legnagyobb_index = i;
|
||||
}
|
||||
}
|
||||
|
||||
return legnagyobb_index;
|
||||
}
|
||||
|
||||
public static void Feladat7()
|
||||
{
|
||||
List<string> reszlegek = new List<string>();
|
||||
|
||||
foreach (var item in Data.munkasok)
|
||||
{
|
||||
if (!reszlegek.Contains(item.Reszleg))
|
||||
{
|
||||
reszlegek.Add(item.Reszleg);
|
||||
}
|
||||
}
|
||||
|
||||
int[] reszleg_db = new int[reszlegek.Count];
|
||||
|
||||
for (int i = 0; i < reszlegek.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < Data.munkasok.Count; j++)
|
||||
{
|
||||
if (reszlegek[i] == Data.munkasok[j].Reszleg)
|
||||
{
|
||||
reszleg_db[i]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < reszlegek.Count; i++)
|
||||
{
|
||||
Console.WriteLine($"{reszlegek[i]} - {reszleg_db[i]} Fő");
|
||||
}
|
||||
}
|
||||
|
||||
public static void DataRead()
|
||||
{
|
||||
string path = @"C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\berek2020.txt";
|
||||
FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read);
|
||||
StreamReader streamReader = new StreamReader(fileStream);
|
||||
|
||||
string line = streamReader.ReadLine();
|
||||
line = streamReader.ReadLine();
|
||||
|
||||
while (line != null)
|
||||
{
|
||||
string[] datas = line.Split(';');
|
||||
string nev = datas[0];
|
||||
string nem = datas[1];
|
||||
string reszleg = datas[2];
|
||||
int belepes = Convert.ToInt32(datas[3]);
|
||||
int ber = Convert.ToInt32(datas[4]);
|
||||
|
||||
Munkas munkas = new Munkas(nev, nem, reszleg, belepes, ber);
|
||||
Data.munkasok.Add(munkas);
|
||||
|
||||
line = streamReader.ReadLine();
|
||||
}
|
||||
|
||||
streamReader.Close();
|
||||
fileStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class Data
|
||||
{
|
||||
public static List<Munkas> munkasok = new List<Munkas>();
|
||||
}
|
||||
public class Munkas
|
||||
{
|
||||
public string Nev { get; private set; }
|
||||
public string Nem { get; private set; }
|
||||
public string Reszleg { get; private set; }
|
||||
public int Belepes { get; private set; }
|
||||
public int Ber { get; private set; }
|
||||
|
||||
public Munkas(string nev, string nem, string reszleg, int belepes, int ber)
|
||||
{
|
||||
Nev = nev;
|
||||
Nem = nem;
|
||||
Reszleg = reszleg;
|
||||
Belepes = belepes;
|
||||
Ber = ber;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
36
20240905/Fizetes/Fizetes/Properties/AssemblyInfo.cs
Normal file
36
20240905/Fizetes/Fizetes/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Fizetes")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Fizetes")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("2927d585-dd8d-4010-94c3-f73c3f228acd")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
BIN
20240905/Fizetes/Fizetes/bin/Debug/Fizetes.exe
Normal file
BIN
20240905/Fizetes/Fizetes/bin/Debug/Fizetes.exe
Normal file
Binary file not shown.
6
20240905/Fizetes/Fizetes/bin/Debug/Fizetes.exe.config
Normal file
6
20240905/Fizetes/Fizetes/bin/Debug/Fizetes.exe.config
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
BIN
20240905/Fizetes/Fizetes/bin/Debug/Fizetes.pdb
Normal file
BIN
20240905/Fizetes/Fizetes/bin/Debug/Fizetes.pdb
Normal file
Binary file not shown.
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
7f4b213b428f4c013f19137338418ee1f5525793
|
||||
@@ -0,0 +1,7 @@
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\bin\Debug\Fizetes.exe.config
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\bin\Debug\Fizetes.exe
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\bin\Debug\Fizetes.pdb
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\obj\Debug\Fizetes.csproj.AssemblyReference.cache
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\obj\Debug\Fizetes.csproj.CoreCompileInputs.cache
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\obj\Debug\Fizetes.exe
|
||||
C:\Users\szabomarton\Desktop\C#\ProgaOra\20240905\Fizetes\Fizetes\obj\Debug\Fizetes.pdb
|
||||
BIN
20240905/Fizetes/Fizetes/obj/Debug/Fizetes.exe
Normal file
BIN
20240905/Fizetes/Fizetes/obj/Debug/Fizetes.exe
Normal file
Binary file not shown.
BIN
20240905/Fizetes/Fizetes/obj/Debug/Fizetes.pdb
Normal file
BIN
20240905/Fizetes/Fizetes/obj/Debug/Fizetes.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user