Autok
This commit is contained in:
25
Auto/Auto.sln
Normal file
25
Auto/Auto.sln
Normal file
@@ -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
|
||||||
36
Auto/Auto/Auto.cs
Normal file
36
Auto/Auto/Auto.cs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
10
Auto/Auto/Auto.csproj
Normal file
10
Auto/Auto/Auto.csproj
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
15
Auto/Auto/Program.cs
Normal file
15
Auto/Auto/Program.cs
Normal file
@@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user