Advertisement
Ivakis

Volleyball

Aug 18th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4. public static void main(String[] args) {
  5.  
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. String year = scanner.nextLine();
  9. double holidays = Double.parseDouble(scanner.nextLine());
  10. double weekends = Double.parseDouble(scanner.nextLine());
  11.  
  12. double sofia = (48 - weekends) * 3.0/4;
  13.  
  14. double holidaysGames = holidays * 2.0/3;
  15.  
  16. double totalGames = sofia + weekends + holidaysGames; // 45
  17.  
  18. if(year.equals("leap")){
  19. totalGames *= 1.15;
  20. }
  21.  
  22. double result = Math.floor(totalGames);
  23.  
  24. System.out.printf("%.0f", result);
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement