This commit is contained in:
Nándor Árgyelán 2024-09-26 11:02:12 +02:00
parent dbde6459b4
commit f2d4434123
9 changed files with 239 additions and 22 deletions

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal abstract class Eszkoz
{
public string name { get; set; }
public string marka { get; set; }
public string allapot { get; set; }
public Eszkoz(string name, string marka, string allapot)
{
this.name = name;
this.marka = marka;
this.allapot = allapot;
}
public void bekapcsolas()
{
allapot = $"{name} bekapcsolva";
}
public void kikapcsolva()
{
allapot = $"{name} kikapcsolva";
}
public override string ToString()
{
return $"{name}, {marka}, {allapot}";
}
public abstract double energiafogyasztas(double uzemora);
}
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal abstract class Eszköz
{
public string name { get; set; }
public string marka { get; set; }
public string allapot { get; set; }
public abstract bekapcsolas()
{
}
}
}

View File

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal interface IHalozatraCsatlakoztathato
{
void csatlakoztatás(string hálózat);
void lecsatlakoztatás();
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal class JatekKonzol : Eszkoz, IHalozatraCsatlakoztathato
{
public string gyarto { get; set; }
public int tarhely { get; set; }
public JatekKonzol(string gyarto, int tarhely, string name, string marka, string allapot) : base(name, marka, allapot)
{
this.gyarto = gyarto;
this.tarhely = tarhely;
}
public void csatlakoztatás(string hálózat)
{
throw new NotImplementedException();
}
public override double energiafogyasztas(double uzemora)
{
throw new NotImplementedException();
}
public void lecsatlakoztatás()
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Metadata.W3cXsd2001;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal class Nyomtato : Eszkoz
{
public string fajta { get; set; }
public int memoria { get; set; }
public string maxMeret { get; set; }
public Nyomtato(string fajta, int memoria, string maxmeret, string name, string marka, string allapot) : base(name, marka, allapot)
{
this.fajta = fajta;
this.memoria = memoria;
this.maxMeret = maxmeret;
}
public void nyomtatas(string szoveg)
{
Console.WriteLine($"{szoveg} kinyomtatva");
}
public void tesztOldal()
{
Console.WriteLine("tesztoldal kinyomtatva");
}
public override double energiafogyasztas(double uzemora)
{
throw new NotImplementedException();
}
}
}

View File

@ -10,6 +10,20 @@ namespace elektronikaieszkozok
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
List<Eszkoz> eszkozok = new List<Eszkoz>();
eszkozok.Add(new Telefon("iphone", "apple", "kikapcsolva", "ios", 12));
eszkozok.Add(new Nyomtato("Lézer", 10, "A3", "Asd234", "Canon", "kikapcsolva"));
eszkozok.Add(new JatekKonzol("microsoft", 1, "xboxOne", "xbox", "kikapcsolva"));
eszkozok.Add(new Tablet(7, 4000000, "tabsUltra", "samsung", "kikapcsolva"));
foreach (var item in eszkozok)
{
item.bekapcsolas();
Console.WriteLine(item);
}
Console.ReadKey();
} }
} }
} }

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal class Tablet : Eszkoz, IHalozatraCsatlakoztathato
{
public int kijelzomeret { get; set; }
public int felbontas { get; set; }
public Tablet(int kijelzo, int felbontas, string name, string marka, string allapot) : base(name, marka, allapot)
{
this.kijelzomeret = kijelzo;
this.felbontas = felbontas;
}
public void csatlakoztatás(string hálózat)
{
throw new NotImplementedException();
}
public override double energiafogyasztas(double uzemora)
{
throw new NotImplementedException();
}
public void jatekJatszas()
{
Console.WriteLine("jatek indul");
}
public void lecsatlakoztatás()
{
throw new NotImplementedException();
}
public void webBongeszes()
{
Console.WriteLine("webboldal betolt");
}
}
}

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace elektronikaieszkozok
{
internal class Telefon : Eszkoz, IHalozatraCsatlakoztathato
{
public string oprendszer { get; set; }
public int kamerafelbontas { get; set; }
public Telefon(string nev,string marka, string allapot, string op, int kamera) : base(nev, marka, allapot)
{
this.oprendszer = op;
this.kamerafelbontas = kamera;
}
public void hivas()
{
Console.WriteLine("hivas inditasa");
}
public void uzenet()
{
Console.WriteLine("uzenet elkuldve");
}
public override double energiafogyasztas(double uzemora)
{
throw new NotImplementedException();
}
public void csatlakoztatás(string hálózat)
{
Console.WriteLine($"csatlakoztatva: {hálózat}");
}
public void lecsatlakoztatás()
{
Console.WriteLine("lecsatlakoztatva a halozatrol");
}
}
}

View File

@ -43,9 +43,14 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Eszköz.cs" /> <Compile Include="Eszkoz.cs" />
<Compile Include="IHalozatraCsatlakoztathato.cs" />
<Compile Include="JatekKonzol.cs" />
<Compile Include="Nyomtato.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tablet.cs" />
<Compile Include="Telefon.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />