using System.Collections.Generic;
using System.Threading.Tasks;
public static void Main()
CarNbgClass c = new CarNbgClass(new VehicleAccClass(4, 3, "pink", 272, 130, 1270) );
Console.WriteLine("{0}", c.Omilos);
public interface INbgInterface
public class CarNbgClass : VehicleAccClass, INbgInterface
private VehicleAccClass VhclAcc;
private string omilos = "Ethniki_Trapeza_tis_Ellados";
Console.WriteLine("Den mporeis na allakseis tin timi tis metavlitis 'omilos' giati einai private.");
public string Sxolia {get;set;}
public CarNbgClass(VehicleAccClass v)
this.Sxolia = "Grapse kati...";
Console.WriteLine("Prepei prota na ftiaxtei sosta to VehicleAccClass object kai meta to Car_Nbg.\nEdo to VehicleAccClass object exei kapoio provlima mallon.");
private Boolean Check(VehicleAccClass v)
Boolean everythingOk = false;
if ( (v.NumWheels > 0) && (v.NumDoors > 0) && (v.Color != "") && (v.HorsePower > 0) && (v.TopSpeed > 0) && (v.Weight > 0) && (v.Owner != "") )
Console.WriteLine("Iparxei kapoio provlima stis parametrous tou aftokinitou sto object Vehicle_Acc. Elegkse to pali.");
Console.WriteLine("Tou omilou: {0}", this.Omilos);
public class VehicleAccClass
private string owner = "Accenture";
Console.WriteLine("A P A G O R E V E T A I na setareis tin metavliti id tou VehicleAccClass object. Setaretai aftomata.");
public VehicleAccClass(int _numWheels, int _numDoors, string _color, int _horsePower, int _topSpeed, double _weight)
this.numWheels = _numWheels;
this.numDoors = _numDoors;
this.horsePower = _horsePower;
this.topSpeed = _topSpeed;
this.id = this.GetHashCode();
public VehicleAccClass() {}
public void ShowDtls(VehicleAccClass v)
Console.WriteLine("\n\n---------------------------");
Console.WriteLine("|*****VehicleAccClass*****|");
Console.WriteLine("|ID: {0}", v.id);
Console.WriteLine("|Number of wheels: {0}", v.numWheels);
Console.WriteLine("|Number of doors: {0}", v.numDoors);
Console.WriteLine("|Color: {0}", v.color);
Console.WriteLine("|Horse power: {0}hp", v.horsePower);
Console.WriteLine("|Top speed: {0}km/h", v.topSpeed);
Console.WriteLine("|Weight: {0}kg", v.weight);
Console.WriteLine("|Owner: {0}", v.owner);
Console.WriteLine("|*****VehicleAccClass*****|");
Console.WriteLine("---------------------------\n\n");
public class NbgListClass<T>
private static List<T> MyList = new List<T>();
public List<T> returnList()