From ad9f80240fa8e653f2dc21c7ab9e88bbb05ae805 Mon Sep 17 00:00:00 2001 From: Robin Cheney Date: Sun, 16 Nov 2025 10:22:10 +0100 Subject: [PATCH] Added method to calculate the total number of employees --- .../de/diejungsvondertanke/tankstelle/Main.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 -- 2.43.0