uszoverseny done

This commit is contained in:
szabomarton
2025-02-14 11:20:29 +01:00
parent deb3b3d48f
commit e855b0fa00
130 changed files with 2130 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,41 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250214\\UszoVerseny\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}|UszoVerseny\\UszoVerseny.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250214\\uszoverseny\\uszoverseny\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}|UszoVerseny\\UszoVerseny.csproj|solutionrelative:uszoverseny\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250214\\UszoVerseny\\UszoVerseny\\Program.cs",
"RelativeDocumentMoniker": "UszoVerseny\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250214\\UszoVerseny\\UszoVerseny\\Program.cs",
"RelativeToolTip": "UszoVerseny\\Program.cs",
"ViewState": "AgIAAFEAAAAAAAAAAAAswHcAAAAjAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-02-14T08:47:41.991Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
}
]
}
]
}
]
}

View File

@@ -0,0 +1,41 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250214\\UszoVerseny\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}|UszoVerseny\\UszoVerseny.csproj|c:\\users\\szabomarton\\desktop\\c#\\progaora\\20250214\\uszoverseny\\uszoverseny\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}|UszoVerseny\\UszoVerseny.csproj|solutionrelative:uszoverseny\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250214\\UszoVerseny\\UszoVerseny\\Program.cs",
"RelativeDocumentMoniker": "UszoVerseny\\Program.cs",
"ToolTip": "C:\\Users\\szabomarton\\Desktop\\C#\\ProgaOra\\20250214\\UszoVerseny\\UszoVerseny\\Program.cs",
"RelativeToolTip": "UszoVerseny\\Program.cs",
"ViewState": "AgIAAFEAAAAAAAAAAAAswHcAAAAjAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-02-14T08:47:41.991Z",
"EditorCaption": ""
},
{
"$type": "Bookmark",
"Name": "ST:0:0:{cce594b6-0c39-4442-ba28-10c64ac7e89f}"
}
]
}
]
}
]
}

View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UszoVerseny", "UszoVerseny\UszoVerseny.csproj", "{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {30E64B9F-C63D-4972-9AA3-2BCE3B014DEA}
EndGlobalSection
EndGlobal

View 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>

View File

@@ -0,0 +1,124 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
namespace UszoVerseny
{
public static class Eredmeny
{
public static List<Uszo> eredmenyek = new List<Uszo>();
public static void AdatokBetoltese(string path)
{
var adatsorok =
File.ReadAllText(path, Encoding.UTF8)
.Split('\n')
.Select(x => x.Trim());
foreach (var item in adatsorok)
{
var adatok = item.Split(';');
bool isNotString = Int32.TryParse(adatok[0].Trim(), out int uid);
if (!isNotString)
{
continue;
}
string unev = adatok[1];
int szulev = Int32.Parse(adatok[2]);
int szulho = Int32.Parse(adatok[3]);
int nem = Int32.Parse(adatok[4]);
double uszoido = Convert.ToDouble(adatok[5].Replace('.',','));
Uszo uszo = new Uszo(uid, unev, szulev, szulho, nem,uszoido);
eredmenyek.Add(uszo);
}
}
public static double AtlagosUszasiIdo()
{
return Convert.ToDouble( eredmenyek.Average(x => x.uszoido));
}
public static void Gyorsak()
{
FileStream fileStream = new FileStream("gyorsak.txt", FileMode.Create, FileAccess.Write);
StreamWriter streamWriter = new StreamWriter(fileStream);
foreach (var item in eredmenyek)
{
if (item.uszoido < 50)
{
streamWriter.WriteLine(item.kilistazas());
}
}
streamWriter.Close();
fileStream.Close();
}
public static void Leggyorsabb()
{
Uszo uszo = eredmenyek.OrderBy(x => x.uszoido).First();
Console.WriteLine(uszo.kilistazas());
}
}
public class Uszo
{
public int uid;
public string unev;
public int szulev;
public int szulho;
// nő 0 || férfi 1
public int nem;
public double uszoido;
public Uszo(int uid, string unev, int szulev, int szulho, int nem, double uszoido)
{
this.uid = uid;
this.unev = unev;
this.szulev = szulev;
this.szulho = szulho;
this.nem = nem;
this.uszoido = uszoido;
}
public string kilistazas()
{
return $"{uid};{unev};{szulev};{szulho};{nem};{uszoido}";
}
}
internal class Program
{
static void Main(string[] args)
{
string path = $@"C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\Feladat\uszoverseny.csv";
Eredmeny.AdatokBetoltese(path);
//5. feladat
Console.WriteLine($"Átlagos úszási idő {Eredmeny.AtlagosUszasiIdo()}");
//6.
Eredmeny.Gyorsak();
//7
Eredmeny.Leggyorsabb();
}
}
}

View File

@@ -0,0 +1,33 @@
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("UszoVerseny")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UszoVerseny")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[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("fede5392-3ef9-4b3b-a5d0-b2f856483df2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View 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>{FEDE5392-3EF9-4B3B-A5D0-B2F856483DF2}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>UszoVerseny</RootNamespace>
<AssemblyName>UszoVerseny</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>

View 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>

View File

@@ -0,0 +1,34 @@
1001;Versenyző_1;2010;8;1;48,96
1006;Versenyző_6;1985;2;1;47,51
1008;Versenyző_8;1989;6;0;48,99
1009;Versenyző_9;1985;8;1;46,08
1012;Versenyző_12;1999;12;1;45,19
1015;Versenyző_15;2000;6;1;48,25
1020;Versenyző_20;1998;6;1;49,39
1021;Versenyző_21;1989;3;1;49,61
1025;Versenyző_25;1989;10;1;49,58
1028;Versenyző_28;1995;1;1;46,79
1033;Versenyző_33;2003;1;0;46,41
1034;Versenyző_34;1985;9;1;45,95
1036;Versenyző_36;2004;4;1;45,36
1038;Versenyző_38;1999;3;0;47,61
1039;Versenyző_39;2003;12;0;47,76
1042;Versenyző_42;1993;1;1;45,95
1046;Versenyző_46;1980;5;0;49,35
1047;Versenyző_47;1980;2;0;45,9
1048;Versenyző_48;1987;2;0;49,47
1049;Versenyző_49;1980;6;1;45,55
1050;Versenyző_50;1983;10;1;49,74
1051;Versenyző_51;2000;11;1;47,39
1056;Versenyző_56;1998;11;1;46,88
1069;Versenyző_69;1980;10;1;49,5
1077;Versenyző_77;1998;12;0;46,95
1078;Versenyző_78;2003;8;0;49,26
1079;Versenyző_79;2008;5;1;49,8
1080;Versenyző_80;1989;7;1;46,9
1088;Versenyző_88;1980;6;1;47,74
1089;Versenyző_89;1981;6;0;47,97
1094;Versenyző_94;2001;2;0;46,11
1095;Versenyző_95;1981;11;0;46,83
1096;Versenyző_96;1995;7;1;49,21
1099;Versenyző_99;1991;1;0;46,65

View File

@@ -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")]

View File

@@ -0,0 +1 @@
137ddb1975586287657f37337b64d051167bb6a147915d9fb5b8eb94b1093509

View File

@@ -0,0 +1,7 @@
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\bin\Debug\UszoVerseny.exe.config
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\bin\Debug\UszoVerseny.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\bin\Debug\UszoVerseny.pdb
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\obj\Debug\UszoVerseny.csproj.AssemblyReference.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\obj\Debug\UszoVerseny.csproj.CoreCompileInputs.cache
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\obj\Debug\UszoVerseny.exe
C:\Users\szabomarton\Desktop\C#\ProgaOra\20250214\UszoVerseny\UszoVerseny\obj\Debug\UszoVerseny.pdb