From: Robin Cheney Date: Sun, 16 Nov 2025 09:11:12 +0000 (+0100) Subject: Corrected some spelling errors X-Git-Url: https://git.eternal.ddnss.de/?a=commitdiff_plain;h=71dda7d2eb5c4834e60fc1b9ff68285f47ba82ff;p=tankstelle.git Corrected some spelling errors --- diff --git a/src/main/java/de/diejungsvondertanke/tankstelle/Main.java b/src/main/java/de/diejungsvondertanke/tankstelle/Main.java index f26d80a..c06085e 100644 --- a/src/main/java/de/diejungsvondertanke/tankstelle/Main.java +++ b/src/main/java/de/diejungsvondertanke/tankstelle/Main.java @@ -96,7 +96,7 @@ public class Main { return highestStation; } - /** + /** * Get the FuelStation with the highest price * * @@ -104,18 +104,19 @@ public class Main { * * @return a FuelStation (all of type {@link FuelStation}) */ - public static FuelStation getHighestAccumulatedWorth() throws NoSuchFuelTypeError { - float highestWorth = fuelStations[0].get_cumulative_retail_price(); + public static FuelStation getHighestAccumulatedValue() throws NoSuchFuelTypeError { + float highestValue = fuelStations[0].get_cumulative_retail_price(); FuelStation highestStation = fuelStations[0]; for (FuelStation fuelStation : fuelStations) { - if (fuelStation.get_cumulative_retail_price() > highestWorth) { - highestWorth = fuelStation.get_cumulative_retail_price(); + if (fuelStation.get_cumulative_retail_price() > highestValue) { + highestValue = fuelStation.get_cumulative_retail_price(); highestStation = fuelStation; } } return highestStation; } - /** + + /** * Get the FuelStation with the stored fuel * * @@ -123,18 +124,19 @@ public class Main { * * @return a FuelStation (all of type {@link FuelStation}) */ - public static FuelStation getHighestStoredAmount(FuelType fuelType) throws NoSuchFuelTypeError{ - float highestAmound = fuelStations[0].getStored_amount(fuelType); + public static FuelStation getHighestStoredAmount(FuelType fuelType) throws NoSuchFuelTypeError { + float highestAmount = fuelStations[0].getStored_amount(fuelType); FuelStation highestStation = fuelStations[0]; for (FuelStation fuelStation : fuelStations) { - if (fuelStation.getStored_amount(fuelType) > highestAmound) { - highestAmound = fuelStation.getStored_amount(fuelType); + if (fuelStation.getStored_amount(fuelType) > highestAmount) { + highestAmount = fuelStation.getStored_amount(fuelType); highestStation = fuelStation; } } return highestStation; } - /** + + /** * Get the FuelStation with the lowest fuel * * @@ -142,20 +144,21 @@ public class Main { * * @return a FuelStation (all of type {@link FuelStation}) */ - public static FuelStation getLowerstStoredAmount(FuelType fuelType) throws NoSuchFuelTypeError{ - float LowestAmound = fuelStations[0].getStored_amount(fuelType); - FuelStation LowestStation = fuelStations[0]; + public static FuelStation getLowestStoredAmount(FuelType fuelType) throws NoSuchFuelTypeError { + float lowestAmount = fuelStations[0].getStored_amount(fuelType); + FuelStation lowestStation = fuelStations[0]; for (FuelStation fuelStation : fuelStations) { - if (fuelStation.getStored_amount(fuelType) > LowestAmound) { - LowestAmound = fuelStation.getStored_amount(fuelType); - LowestStation = fuelStation; + if (fuelStation.getStored_amount(fuelType) > lowestAmount) { + lowestAmount = fuelStation.getStored_amount(fuelType); + lowestStation = fuelStation; } } - return LowestStation; + return lowestStation; } /** - * Check {@code pin} for the correct PIN number + * Check {@code pin} for the correct PIN number (read from the resource + * /pin.txt) * * @param pin the PIN to check * @return true, if the pin is correct, false otherwise