first commit

This commit is contained in:
Tóth Ádám
2024-11-19 19:04:02 +01:00
commit de464b937d
8837 changed files with 493452 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\orai0904.sln",
"PreviewInSolutionExplorer": false
}

View 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}") = "orai0904", "orai0904\orai0904.csproj", "{7C728285-3621-472F-8BAB-AEE42D884C34}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7C728285-3621-472F-8BAB-AEE42D884C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7C728285-3621-472F-8BAB-AEE42D884C34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7C728285-3621-472F-8BAB-AEE42D884C34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7C728285-3621-472F-8BAB-AEE42D884C34}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F20A8B2D-FD3A-4DAC-BD59-444A52DC9D35}
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,146 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace orai0904
{
class Orszag
{
public string Orszagnev { get; private set; }
public int Terulet { get; private set; }
public int Nepesseg { get; private set; }
public string Fovaros { get; private set; }
public int FovarosNepesseg { get; private set; }
public List<Orszag> adatok;
public Orszag(string orszagnev, int terulet, int nepesseg, string fovaros, int fovarosNepesseg)
{
Orszagnev = orszagnev;
Terulet = terulet;
Nepesseg = nepesseg;
Fovaros = fovaros;
FovarosNepesseg = fovarosNepesseg;
}
public bool nagyobbe()
{
return FovarosNepesseg > 0 && ((double)FovarosNepesseg / Nepesseg) > 0.0003;
}
public Orszag()
{
}
public void feladat2()
{
adatok = new List<Orszag>();
StreamReader sr = new StreamReader("adatok-utf8.txt");
while (!sr.EndOfStream)
{
string[] sor = sr.ReadLine().Split(';');
Orszag o = new Orszag()
{
Orszagnev = sor[0],
Terulet = Convert.ToInt32(sor[1]),
Nepesseg = Convert.ToInt32(sor[2]),
Fovaros = sor[3],
FovarosNepesseg = Convert.ToInt32(sor[4])
};
adatok.Add(o);
}
}
public void feladat3()
{
Console.WriteLine($"A beolvasott országok száma: {adatok.Count}");
}
public void feladat4()
{
foreach (var item in adatok)
{
double terulet = item.Nepesseg / item.Terulet;
if (item.Orszagnev == "Kína")
{
Console.WriteLine($"Kíne népsűrűsége: {terulet}fő/km^2");
}
}
}
public void feladat5()
{
int kinalakos = 0;
int indialakos = 0;
foreach (var item in adatok)
{
if (item.Orszagnev == "Kína")
{
kinalakos = item.Nepesseg;
}
if (item.Orszagnev == "India")
{
indialakos = item.Nepesseg;
}
}
Console.WriteLine($"Kína lakosság {kinalakos - indialakos} fővel volt több");
}
public void feladat6()
{
int[] nepesseg = { };
foreach (var item in adatok)
{
nepesseg = nepesseg.Append(item.Nepesseg).ToArray();
}
nepesseg = nepesseg.OrderByDescending(c => c).ToArray();
foreach (var item in adatok)
{
if (nepesseg[2] == item.Nepesseg)
{
Console.WriteLine($"A harmadik legnépesebb ország: {item.Orszagnev}, a lakosság {item.Nepesseg} fő");
}
}
}
public void feladat7()
{
Console.WriteLine($"A következő országok lakosságának több mint 30%-a a fővárosban lakik:");
foreach (var orszag in adatok.Where(o => o.nagyobbe()))
{
Console.WriteLine($"\t{orszag.Orszagnev} - ({orszag.Fovaros})");
}
}
public override string ToString()
{
return "";
}
}
class Program
{
static void Main(string[] args)
{
Orszag o = new Orszag();
o.feladat2();
o.feladat3();
o.feladat4();
o.feladat5();
o.feladat6();
o.feladat7();
Console.ReadKey();
}
}
}

View 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("orai0904")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("orai0904")]
[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("7c728285-3621-472f-8bab-aee42d884c34")]
// 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")]

View File

@@ -0,0 +1,49 @@
Görögország;132000;10640000;Athén;3154
Románia;238400;19120000;Bukarest;1812
Ausztria;83900;8960000;Bécs;1915
Lengyelország;312700;37750000;Varsó;1776
Belgium;30500;11590000;Brüsszel;2065
Bulgária;110400;6880000;Szófia;1277
Ciprus;9300;900000;Nicosia;270
Csehország;78900;10510000;Prága;1299
Dánia;42900;5860000;Koppenhága;1334
Észtország;45400;1330000;Tallinn;441
Finnország;336900;5540000;Helsinki;1292
Franciaország;551500;67750000;Párizs;10958
Hollandia;41500;17530000;Amszterdam;1140
Horvátország;56600;3960000;Zágráb;685
Írország;69800;5030000;Dublin;1215
Lettország;64600;1880000;Riga;634
Litvánia;65300;2800000;Vilnius;538
Luxemburg;2600;640000;Luxembourg;120
Magyarország;93000;9710000;Budapest;1764
Málta;300;520000;Valletta;213
Németország;357600;83200000;Berlin;3557
Olaszország;302100;59110000;Róma;4234
Portugália;92200;10330000;Lisszabon;2942
Spanyolország;506000;47420000;Madrid;6559
Svédország;438600;10420000;Stockholm;1608
Szlovákia;49000;5450000;Pozsony;433
Szlovénia;20300;2110000;Ljubljana;287
Egyesült Királyság;244400;67330000;London;9177
Izland;103000;370000;Reykjavík;216
Észak-Macedónia;25700;1950000;Szkopje;590
Montenegró;13900;620000;Podgorica;177
Norvégia;323800;5410000;Osló;1027
Oroszország;17098200;143450000;Moszkva;12476
Svájc;41300;8700000;Bern;426
Szerbia;88400;6830000;Belgrád;1394
Törökország;783600;84150000;Ankara;5018
India;3287300;1393410000;Új-Delhi;29399
Izrael;22100;9360000;Jeruzsálem;919
Japán;377900;125680000;Tokió;37435
Kína;9600000;1412360000;Peking;20036
Koreai Köztársaság;100400;51740000;Szöul;9962
Dél-afrikai Köztársaság;1221000;60040000;Pretoriap;2473
Egyiptom;1002000;104260000;Kairó;20485
Brazília;8510300;213990000;Brasilia;4559
Egyesült Államok;9833500;331890000;Washington, D.C.;5265
Kanada;9984700;38250000;Ottawa;1378
Mexikó;1964400;130260000;Mexikóváros;21672
Ausztrália;7692000;25740000;Canberra;453
Új-Zéland;268100;5120000;Wellington;413

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,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,14 @@
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\bin\Debug\orai0904.exe.config
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\bin\Debug\orai0904.exe
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\bin\Debug\orai0904.pdb
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\obj\Debug\orai0904.csproj.AssemblyReference.cache
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\obj\Debug\orai0904.csproj.CoreCompileInputs.cache
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\obj\Debug\orai0904.exe
C:\Users\tothlaszlo\source\repos\orai0904\orai0904\obj\Debug\orai0904.pdb
C:\Users\Laci\source\repos\orai0904\orai0904\bin\Debug\orai0904.exe.config
C:\Users\Laci\source\repos\orai0904\orai0904\bin\Debug\orai0904.exe
C:\Users\Laci\source\repos\orai0904\orai0904\bin\Debug\orai0904.pdb
C:\Users\Laci\source\repos\orai0904\orai0904\obj\Debug\orai0904.csproj.AssemblyReference.cache
C:\Users\Laci\source\repos\orai0904\orai0904\obj\Debug\orai0904.csproj.CoreCompileInputs.cache
C:\Users\Laci\source\repos\orai0904\orai0904\obj\Debug\orai0904.exe
C:\Users\Laci\source\repos\orai0904\orai0904\obj\Debug\orai0904.pdb

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,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>{7C728285-3621-472F-8BAB-AEE42D884C34}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>orai0904</RootNamespace>
<AssemblyName>orai0904</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>