private void check(Data data) { LocalDate date = data.getDate(); double price = bill.getTotalPrice(); if (date.getYear() > 2015 && date.getMonth().equals(Month.SEPTEMBER) && date.getDayOfMonth() < 8 && date.getDayOfWeek().equals(DayOfWeek.SATURDAY)) { price *= 1; bill.setTotalPrice(price); logger.info(resourceBundle.getString("noTips")); bill.setTips(resourceBundle.getString("noTips")); } else { double tips = 0.05 * bill.getTotalPrice(); price *= 1.05; bill.setTotalPrice(price); logger.info(resourceBundle.getString("payForTips") + tips); bill.setTips(resourceBundle.getString("payForTips") + " " + String.format(" %.2f ", tips)); } }