Compare commits
2 Commits
311d9b790f
...
master
Author | SHA1 | Date | |
---|---|---|---|
caa18acd08 | |||
1101f1689e |
32
KartyaOszto/ClassDiagram1.cd
Normal file
32
KartyaOszto/ClassDiagram1.cd
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ClassDiagram MajorVersion="1" MinorVersion="1">
|
||||
<Class Name="KartyaOszto.OsztoProgram">
|
||||
<Position X="3" Y="1.5" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAEAAAAAAAAAAAAEAAAAAAACAAAAAACgCBAAAAAA=</HashCode>
|
||||
<FileName>OsztoProgram.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="KartyaOszto.Kartyalap">
|
||||
<Position X="7.75" Y="2.25" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAEAAACAAAAAAAAAAAAAAAAAAAACAA=</HashCode>
|
||||
<FileName>Kartyalap.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="KartyaOszto.Jatekos">
|
||||
<Position X="5.25" Y="3.25" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAAAAAAAAAAAAAgAAAAAAQAAAAAAAEAAACAAAA=</HashCode>
|
||||
<FileName>Jatekos.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Class Name="KartyaOszto.KartyaCsomag">
|
||||
<Position X="5.25" Y="0.75" Width="1.5" />
|
||||
<TypeIdentifier>
|
||||
<HashCode>AAAAAAAIAAAAAAAAAAABAAAAAAAAAAAAAAAAAACAAAA=</HashCode>
|
||||
<FileName>KartyaCsomag.cs</FileName>
|
||||
</TypeIdentifier>
|
||||
</Class>
|
||||
<Font Name="Segoe UI" Size="9" />
|
||||
</ClassDiagram>
|
|
@ -23,6 +23,7 @@ namespace KartyaOszto
|
|||
{
|
||||
lapok[felvett] = kl;
|
||||
felvett++;
|
||||
Console.WriteLine($"{nev} felvette: "+ kl.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ namespace KartyaOszto
|
|||
class KartyaCsomag
|
||||
{
|
||||
public Kartyalap[] lapok;
|
||||
private int levett;
|
||||
|
||||
public KartyaCsomag()
|
||||
{
|
||||
|
@ -27,6 +28,18 @@ namespace KartyaOszto
|
|||
laphely++;
|
||||
}
|
||||
}
|
||||
levett = 0;
|
||||
}
|
||||
|
||||
public List<Kartyalap> levesz(int lapdb)
|
||||
{
|
||||
List<Kartyalap> laplista = new List<Kartyalap>();
|
||||
for (int i = 0; i < lapdb; i++)
|
||||
{
|
||||
laplista.Add(lapok[levett]);
|
||||
levett++;
|
||||
}
|
||||
return laplista;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace KartyaOszto
|
||||
{
|
||||
|
@ -24,6 +25,7 @@ namespace KartyaOszto
|
|||
string jnev = "Játékos-" + i;
|
||||
jatekosok[i] = new Jatekos(jnev,jatekosLapSzam);
|
||||
}
|
||||
Osztas();
|
||||
|
||||
} else
|
||||
{
|
||||
|
@ -45,9 +47,15 @@ namespace KartyaOszto
|
|||
|
||||
static void Osztas()
|
||||
{
|
||||
int kor = jatekosLapSzam / hanyasaval;
|
||||
for (int i = 0; i < kor; i++)
|
||||
{
|
||||
Console.WriteLine($"Az osztás {i+1}. köre");
|
||||
foreach (Jatekos j in jatekosok)
|
||||
{
|
||||
|
||||
List<Kartyalap> osztott = pakli.levesz(hanyasaval);
|
||||
j.Felvesz(osztott);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
67
LakoEpulet/Epulet.cs
Normal file
67
LakoEpulet/Epulet.cs
Normal file
|
@ -0,0 +1,67 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
|
||||
namespace LakoEpulet
|
||||
{
|
||||
|
||||
class Festek
|
||||
{
|
||||
public static double literpernegyzetmeter = 0.3;
|
||||
}
|
||||
class Epulet
|
||||
{
|
||||
private List<LakoHelyiseg> helyisegek;
|
||||
|
||||
//A szükséges falfesték property-ként
|
||||
public double FalfestekLiter
|
||||
{
|
||||
get
|
||||
{
|
||||
double ofelulet = 0;
|
||||
foreach (var item in helyisegek)
|
||||
{
|
||||
ofelulet += item.falfelulet + item.mennyezet();
|
||||
}
|
||||
return ofelulet * Festek.literpernegyzetmeter;
|
||||
}
|
||||
}
|
||||
|
||||
public Epulet()
|
||||
{
|
||||
helyisegek = new List<LakoHelyiseg>();
|
||||
}
|
||||
|
||||
public void bekeres()
|
||||
{
|
||||
Console.WriteLine("Hány helyiség van az épületben?");
|
||||
int hdb = int.Parse(Console.ReadLine());
|
||||
for (int i = 0; i < hdb; i++)
|
||||
{
|
||||
Console.WriteLine($"Az {i+1}. helyiség adatai:");
|
||||
Console.Write("szélessége: ");
|
||||
double sz = double.Parse(Console.ReadLine().Replace('.', ','));
|
||||
Console.Write("hosszúsága: ");
|
||||
double h = double.Parse(Console.ReadLine().Replace('.', ','));
|
||||
Console.Write("magassága: ");
|
||||
double m = double.Parse(Console.ReadLine().Replace('.',','));
|
||||
LakoHelyiseg ujh = new LakoHelyiseg(sz, h, m);
|
||||
helyisegek.Add(ujh);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public double Burkolat()
|
||||
{
|
||||
double oterulet = 0;
|
||||
foreach (var item in helyisegek)
|
||||
{
|
||||
oterulet += item.alapterulet;
|
||||
}
|
||||
return oterulet;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
8
LakoEpulet/LakoEpulet.csproj
Normal file
8
LakoEpulet/LakoEpulet.csproj
Normal file
|
@ -0,0 +1,8 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
50
LakoEpulet/LakoHelyiseg.cs
Normal file
50
LakoEpulet/LakoHelyiseg.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace LakoEpulet
|
||||
{
|
||||
class LakoHelyiseg
|
||||
{
|
||||
|
||||
//Publikus adattag változók
|
||||
public double szelesseg;
|
||||
public double hosszusag;
|
||||
public double magassag;
|
||||
|
||||
//Property - Tulajdonság
|
||||
public double alapterulet
|
||||
{
|
||||
get { return szelesseg*hosszusag; }
|
||||
|
||||
}
|
||||
|
||||
public double falfelulet
|
||||
{
|
||||
get {
|
||||
return (2 * szelesseg + 2 * hosszusag) * magassag;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public LakoHelyiseg(double szelesseg,double hosszusag,double magassag)
|
||||
{
|
||||
this.szelesseg = szelesseg;
|
||||
this.hosszusag = hosszusag;
|
||||
this.magassag = magassag;
|
||||
|
||||
}
|
||||
|
||||
//Adatok kiolvasása metódusokkal
|
||||
public double mennyezet()
|
||||
{
|
||||
return szelesseg * hosszusag;
|
||||
}
|
||||
|
||||
public double legkobmeter()
|
||||
{
|
||||
return szelesseg * hosszusag * magassag;
|
||||
}
|
||||
}
|
||||
}
|
15
LakoEpulet/Program.cs
Normal file
15
LakoEpulet/Program.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace LakoEpulet
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Epulet ujepulet = new Epulet();
|
||||
ujepulet.bekeres();
|
||||
Console.WriteLine($"A szükséges festékmennyiség: {ujepulet.FalfestekLiter:F2} liter");
|
||||
Console.WriteLine($"A szükséges padlólap: {ujepulet.Burkolat()} nm");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31624.102
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KartyaOszto", "KartyaOszto\KartyaOszto.csproj", "{3B2D2794-EA0A-4863-B594-87FFDC8E9605}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KartyaOszto", "KartyaOszto\KartyaOszto.csproj", "{3B2D2794-EA0A-4863-B594-87FFDC8E9605}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LakoEpulet", "LakoEpulet\LakoEpulet.csproj", "{411543CA-172A-413E-B444-4C59C9A668EE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -15,6 +17,10 @@ Global
|
|||
{3B2D2794-EA0A-4863-B594-87FFDC8E9605}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3B2D2794-EA0A-4863-B594-87FFDC8E9605}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3B2D2794-EA0A-4863-B594-87FFDC8E9605}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{411543CA-172A-413E-B444-4C59C9A668EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{411543CA-172A-413E-B444-4C59C9A668EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{411543CA-172A-413E-B444-4C59C9A668EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{411543CA-172A-413E-B444-4C59C9A668EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
Loading…
Reference in New Issue
Block a user