keszverzio Verzio 1

This commit is contained in:
tothgergo
2026-09-15 12:53:49 +02:00
parent b729be9087
commit 7b28895b2c
6 changed files with 126 additions and 17 deletions

37
SzimulaciOOP/fonok.cs Normal file
View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SzimulaciOOP
{
internal class fonok
{
public benzinkut Cegeskut;
public fonok()
{
//építtetünk a főnökkel egy kutat
Cegeskut = new benzinkut();
}
public void tankolnikuld(auto kocsi,benzinkut cegeskut)
{
cegeskut.tankol(kocsi);
}
public void megindit(string autonev, double autoutja, double autotankja)
{
auto kuldottkocsi = new auto(autonev, autotankja, autoutja);
if (kuldottkocsi.hianyzoBenzin <=0)
{
Console.WriteLine($"A küldött autó: {kuldottkocsi.nev} gond nélkül elérkezett a célhoz {kuldottkocsi.megteendoUt} km-re");
}
else
{
tankolnikuld(kuldottkocsi, Cegeskut);
}
}
}
}