keszverzio Verzio 1
This commit is contained in:
37
SzimulaciOOP/fonok.cs
Normal file
37
SzimulaciOOP/fonok.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user