From b8e3fb871c7efd46e8c27abccdf58e865874bb78 Mon Sep 17 00:00:00 2001 From: pp Date: Fri, 10 Feb 2023 18:57:31 +0100 Subject: [PATCH] Add project files. --- TeglalapObjektum.sln | 25 ++++++++++++++++++ TeglalapObjektum/Program.cs | 32 ++++++++++++++++++++++++ TeglalapObjektum/Teglalap.cs | 22 ++++++++++++++++ TeglalapObjektum/TeglalapObjektum.csproj | 8 ++++++ 4 files changed, 87 insertions(+) create mode 100644 TeglalapObjektum.sln create mode 100644 TeglalapObjektum/Program.cs create mode 100644 TeglalapObjektum/Teglalap.cs create mode 100644 TeglalapObjektum/TeglalapObjektum.csproj diff --git a/TeglalapObjektum.sln b/TeglalapObjektum.sln new file mode 100644 index 0000000..aeab5b8 --- /dev/null +++ b/TeglalapObjektum.sln @@ -0,0 +1,25 @@ + +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}") = "TeglalapObjektum", "TeglalapObjektum\TeglalapObjektum.csproj", "{F172D148-E6EB-4754-916A-B8F2CC2C3AA7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F172D148-E6EB-4754-916A-B8F2CC2C3AA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F172D148-E6EB-4754-916A-B8F2CC2C3AA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F172D148-E6EB-4754-916A-B8F2CC2C3AA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F172D148-E6EB-4754-916A-B8F2CC2C3AA7}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {41E1AEE0-5F02-41C1-AB2F-BE5139837720} + EndGlobalSection +EndGlobal diff --git a/TeglalapObjektum/Program.cs b/TeglalapObjektum/Program.cs new file mode 100644 index 0000000..bf34f3a --- /dev/null +++ b/TeglalapObjektum/Program.cs @@ -0,0 +1,32 @@ +using System; + +namespace TeglalapObjektum +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Téglalap objektumok létrehozása:"); + Teglalap t1 = new Teglalap(); //Példányosítás t1 + Teglalap t2 = new Teglalap(); //Példányosítás t2 + t1.aoldal = 7.5; + t1.boldal = 20.9; + t2.aoldal = 100; + t2.boldal = 24.7; + Console.WriteLine($"A t1 téglalap a: {t1.aoldal}, b: {t1.boldal} T: {t1.terulet()}"); + Console.WriteLine($"A t2 téglalap a: {t2.aoldal}, b: {t2.boldal} T: {t2.terulet()}"); + + Teglalap t3 = new Teglalap(); + t3.aoldal = 3; + t3.boldal = 120; + Console.WriteLine("t3 adatai:"); + t3.kiir(); + Console.WriteLine("t1 adatai:"); + t1.kiir(); + + + } + + + } +} diff --git a/TeglalapObjektum/Teglalap.cs b/TeglalapObjektum/Teglalap.cs new file mode 100644 index 0000000..642a3fc --- /dev/null +++ b/TeglalapObjektum/Teglalap.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace TeglalapObjektum +{ + class Teglalap + { + public double aoldal; + public double boldal; + + public double terulet() + { + return aoldal * boldal; + } + + public void kiir() + { + Console.WriteLine($"a: {aoldal}, b: {boldal}, T: {terulet():F3}"); + } + } +} diff --git a/TeglalapObjektum/TeglalapObjektum.csproj b/TeglalapObjektum/TeglalapObjektum.csproj new file mode 100644 index 0000000..c73e0d1 --- /dev/null +++ b/TeglalapObjektum/TeglalapObjektum.csproj @@ -0,0 +1,8 @@ + + + + Exe + netcoreapp3.1 + + +