Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public double totalPrice() {
  2. System.out.println("pris:" + participant.name);
  3. double days = ChronoUnit.DAYS.between(getArrivalDate(), getDepartureDate().plusDays(1));
  4. double price = 0;
  5. if (!participant.isLecturer()) {
  6. price = (conference.getPrice() * days);
  7. }
  8. System.out.println("pris efter foredragsholder" + price);
  9. if (hotel != null) {
  10. if (companion != null) {
  11. price += hotel.getPriceRoom2() * (days - 1);
  12. } else {
  13. price += hotel.getPriceRoom1() * (days - 1);
  14. }
  15. }
  16. System.out.println("Pris efter hotel" + price);
  17. if (companion != null) {
  18. price += companion.excurtionPrice();
  19. }
  20. System.out.println("Pris efter udflugt" + price);
  21. for (Extra e : extraList) {
  22. price += e.getAppendixPrice() * (days -1);
  23. }
  24. System.out.println("Pris efter extras" + price);
  25.  
  26.  
  27. return price;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement