Advertisement
SIRAKOV4444

Untitled

Apr 4th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1.  
  2.  
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class Volleyball {
  7.  
  8. public static void main(String[] args) {
  9.  
  10. Scanner console = new Scanner(System.in);
  11. String year = console.nextLine().toLowerCase();
  12. int holidays = Integer.parseInt(console.nextLine());
  13. int travel = Integer.parseInt(console.nextLine());
  14.  
  15. double weekends = -1;
  16. double freeWeekends = -1;
  17. double total = -1;
  18. double saturdayGames = -1;
  19. double holidayGames = -1;
  20. double totalPlus15 = -1;
  21.  
  22. if (year.equals("leap")) {
  23. weekends = 48.0;
  24. freeWeekends = weekends - travel;
  25. saturdayGames = freeWeekends * 3/4.0;
  26. holidayGames = holidays * 2/3.0;
  27. total = saturdayGames + travel + holidayGames;
  28. totalPlus15 = total * 1.15;
  29. System.out.println(Math.floor(totalPlus15));
  30. } else if (year.equals("normal")) {
  31. weekends = 48.0;
  32. freeWeekends = weekends - travel;
  33. saturdayGames = freeWeekends * 3/4.0;
  34. holidayGames = holidays * 2/3.0;
  35. total = saturdayGames + travel + holidayGames;;
  36. System.out.println(Math.floor(total));
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement