Add project files.
This commit is contained in:
parent
62dea1a321
commit
b8e3fb871c
25
TeglalapObjektum.sln
Normal file
25
TeglalapObjektum.sln
Normal file
|
@ -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
|
32
TeglalapObjektum/Program.cs
Normal file
32
TeglalapObjektum/Program.cs
Normal file
|
@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
22
TeglalapObjektum/Teglalap.cs
Normal file
22
TeglalapObjektum/Teglalap.cs
Normal file
|
@ -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}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
TeglalapObjektum/TeglalapObjektum.csproj
Normal file
8
TeglalapObjektum/TeglalapObjektum.csproj
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user