using System.Collections.Generic;
public abstract class MobilniZarizeni
public string VyrobniKod;
public abstract void Spustit();
public string OperacniSystem;
public class Smartphone : MobilniZarizeni, IUmiFotit, IUmiCist
public Smartphone(string kod, string os)
public override void Spustit()
Console.WriteLine("Spoustim Smartphone");
public void UdelejFotku(string fotka)
Console.WriteLine("Delam fotku {0}", fotka);
public void PrectiOtisk(string otisk, bool vysledek)
Console.WriteLine("Ctu {0} a identifikace je {1}", otisk, vysledek);
void IUmiCist.NahrajOtisk(string notisk)
throw new NotImplementedException();
void IUmiCist.PrectiOtisk(string otisk, bool vysledek)
throw new NotImplementedException();
public class Tablet : MobilniZarizeni, IUmiFotit
public Tablet(string kod, string os)
public override void Spustit()
Console.WriteLine("Spoustim Tablet");
public void UdelejFotku(string fotka)
Console.WriteLine("Delam fotku {0}", fotka);
public class Notebook : MobilniZarizeni, IUmiCist
public Notebook(string kod, string os)
public override void Spustit()
Console.WriteLine("Spoustim Notebook");
public void PrectiOtisk(string otisk, bool vysledek)
Console.WriteLine("Ctu {0} a identifikace je {1}", otisk, vysledek);
void IUmiCist.NahrajOtisk(string notisk)
throw new NotImplementedException();
void IUmiCist.PrectiOtisk(string otisk, bool vysledek)
throw new NotImplementedException();
void UdelejFotku(string fotka);
void NahrajOtisk(string notisk);
void PrectiOtisk(string otisk, bool vysledek);
public static void Main()
Smartphone smartphone = new Smartphone("1234", "Android");
Tablet tablet = new Tablet("3456", "iOS");
Notebook notebook = new Notebook("6789", "Windows");
var eshop = new List<MobilniZarizeni>()
foreach (MobilniZarizeni item in eshop)
Smartphone smartphoneA = (Smartphone)item;
Console.WriteLine("Kod {0} a operacni system {1}", smartphoneA.VyrobniKod, smartphoneA.OperacniSystem);
smartphoneA.PrectiOtisk("otisk ukazovacka", true);
Tablet tabletB = (Tablet)item;
Console.WriteLine("Kod {0} a operacni system {1}", tabletB.VyrobniKod, tabletB.OperacniSystem);
tabletB.UdelejFotku("Eifelovky");
Notebook notebookC = (Notebook)item;
Console.WriteLine("Kod {0} a operacni system {1}", notebookC.VyrobniKod, notebookC.OperacniSystem);
notebookC.PrectiOtisk("otisk palce", false);