Add project files.

This commit is contained in:
István Priskin 2023-02-10 18:57:31 +01:00
parent 62dea1a321
commit b8e3fb871c
4 changed files with 87 additions and 0 deletions

25
TeglalapObjektum.sln Normal file
View 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

View 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();
}
}
}

View 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}");
}
}
}

View File

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
</Project>