From: Robin Cheney Date: Sun, 16 Nov 2025 09:22:10 +0000 (+0100) Subject: Added method to calculate the total number of employees X-Git-Url: https://git.eternal.ddnss.de/?a=commitdiff_plain;h=ad9f80240fa8e653f2dc21c7ab9e88bbb05ae805;p=tankstelle.git Added method to calculate the total number of employees --- diff --git a/src/main/java/de/diejungsvondertanke/tankstelle/Main.java b/src/main/java/de/diejungsvondertanke/tankstelle/Main.java index c06085e..8b3ba1f 100644 --- a/src/main/java/de/diejungsvondertanke/tankstelle/Main.java +++ b/src/main/java/de/diejungsvondertanke/tankstelle/Main.java @@ -192,4 +192,18 @@ public class Main { } return result.toArray(new FuelStation[0]); } + + /** + * Calculate and return the total number of employees across all + * {@link FuelStation fuel station}s + * + * @return total staff count + */ + public static int getTotalNumberOfEmployees() { + int sum = 0; + for (FuelStation station : fuelStations) { + sum += station.getNumber_of_employees(); + } + return sum; + } } \ No newline at end of file