diff --git a/Auto/Auto.sln b/Auto/Auto.sln new file mode 100644 index 0000000..e454376 --- /dev/null +++ b/Auto/Auto.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35222.181 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Auto", "Auto\Auto.csproj", "{39485DAE-C87A-4F35-9548-FE115BEF98DD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39485DAE-C87A-4F35-9548-FE115BEF98DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39485DAE-C87A-4F35-9548-FE115BEF98DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39485DAE-C87A-4F35-9548-FE115BEF98DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39485DAE-C87A-4F35-9548-FE115BEF98DD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D2C23DBF-79F3-4DA1-A2DC-5ABC2CBE5DFB} + EndGlobalSection +EndGlobal diff --git a/Auto/Auto/Auto.cs b/Auto/Auto/Auto.cs new file mode 100644 index 0000000..38842b4 --- /dev/null +++ b/Auto/Auto/Auto.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Auto +{ + public class Auto + { + + + public string Marka { get; set; } + public string Tipus { get; set; } + public int GyartasiEv { get; set; } + public int FutottKm { get; set; } + public string Rendszam { get; set; } + + //Készítsen paraméteres konstruktort a propertyk beállításához + public Auto(string marka, string tipus, int gyartasiEv, int futottKm, string rendszam) + { + Marka = marka; + Tipus = tipus; + GyartasiEv = gyartasiEv; + FutottKm = futottKm; + Rendszam = rendszam; + } + + //Készítsen metódust, amely visszaadja az Autó korát! + public int AutoKor() + { + return DateTime.Now.Year - GyartasiEv; + } + + } +} diff --git a/Auto/Auto/Auto.csproj b/Auto/Auto/Auto.csproj new file mode 100644 index 0000000..2150e37 --- /dev/null +++ b/Auto/Auto/Auto.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/Auto/Auto/Program.cs b/Auto/Auto/Program.cs new file mode 100644 index 0000000..941834d --- /dev/null +++ b/Auto/Auto/Program.cs @@ -0,0 +1,15 @@ +namespace Auto +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Autók"); + + Auto auto1 = new Auto("Opel", "Astra", 2010, 213000, "PRG028"); + Auto auto2 = new Auto("Audi", "A4", 2016, 419000, "RGB128"); + + Console.WriteLine(auto1.AutoKor()); + } + } +}