Ich habe ein Array wie dieseMit foreach-Schleife mit List <>
public List<Application> all_roads = new List<Application>();
Und ein Objekt mit Feldern:
public string point_of_distination;
public uint length_of_route;
public double price;
public string our_drv_name;
public string our_drv_surname;
public string our_bus_model;
public double gen_ticket_price;
public short cur_year;
public byte cur_day;
public byte cur_month;
public double tour_consumption;
I allgemeine Summe von tour_consumption
von allen Objekten zählen möchte. Wie soll ich foreach
Schleife dafür schreiben? Bitte, hilf mir.
'foreach (Application a in all_roads)' – Uriel
Danke, Uriel Eli. Du hast recht! – Snorri
Für zukünftige Referenz lesen Sie bitte [diesen Artikel] (http://meta.programmers.stackexchange.com/questions/6166/open-letter-to-students-with-homework-problems), wie Sie um Hilfe bei den Hausaufgaben bitten können . – EJoshuaS