Dido09

Volleyball

Oct 1st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Volleyball {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. String leapN = scanner.nextLine();
  8. double praznici = Double.parseDouble(scanner.nextLine());
  9. int home = Integer.parseInt(scanner.nextLine());
  10.  
  11. int sofWeek = 48 - home;
  12. double SaturdayPlaySof = (sofWeek * 0.75);
  13.  
  14. double prazniciPlaySof = (praznici * 0.666666667);
  15.  
  16. double totalPlaysSofHome = SaturdayPlaySof + home + prazniciPlaySof;
  17.  
  18. if (leapN.equals("leap"))
  19. {
  20. double leapYear = (totalPlaysSofHome * 15) / 100;
  21. double leapYearPlays = totalPlaysSofHome + leapYear;
  22. System.out.println(Math.floor(leapYearPlays));
  23. }
  24. else
  25. {
  26. System.out.println(Math.floor(totalPlaysSofHome));
  27. }
  28.  
  29. }
  30. }
Add Comment
Please, Sign In to add comment