38 lines
974 B
C#
38 lines
974 B
C#
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);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|