return highestStation;
}
- /**
+ /**
* Get the FuelStation with the highest price
*
*
*
* @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
*
*
*
* @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
*
*
*
* @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