Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package lemondasidij;
  7.  
  8. import java.time.DayOfWeek;
  9. import static java.time.DayOfWeek.*;
  10. import java.time.LocalDateTime;
  11. import java.time.temporal.TemporalAdjusters;
  12. import static java.time.temporal.TemporalQueries.localDate;
  13.  
  14. /**
  15. *
  16. * @author
  17. */
  18. public class Szallas {
  19.  
  20. private LocalDateTime erkezes;
  21.  
  22. public Szallas(LocalDateTime erkezes) {
  23. this.erkezes = erkezes.withHour(14).withMinute(00);
  24. }
  25.  
  26. public int getVisszajaroSzazalek(LocalDateTime mikor) {
  27.  
  28. LocalDateTime nulla = this.erkezes.minusDays(1);
  29.  
  30. if (mikor.isAfter(nulla)) {
  31. return 0;
  32. }
  33. LocalDateTime szaz = this.erkezes.minusMonths(1);
  34.  
  35. if (mikor.isBefore(szaz)) {
  36. return 100;
  37. }
  38.  
  39.  
  40.  
  41.  
  42. if ( mikor.isAfter(kilencven) && mikor.isBefore(nulla) ) {
  43. return 50;
  44. } else {
  45.  
  46. return 90;
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement