borkins

12. Volleyball

Mar 27th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. /**
  2.  * Project: Complex_Conditions - created by borkins on 2017-03-27.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. public class _12_Volleyball
  8. {
  9.     public static void main(String[] args)
  10.     {
  11.         Scanner console = new Scanner(System.in);
  12.        
  13.         String yearType = console.nextLine();
  14.         int holidays = Integer.parseInt(console.nextLine());
  15.         int daysHome = Integer.parseInt(console.nextLine());
  16.        
  17.         double playCount = daysHome + ((48 - daysHome) * 3d / 4) + (holidays * 2d / 3);
  18.        
  19.         if (yearType.equals("leap")) {
  20.             playCount += playCount * 0.15;
  21.         }
  22.        
  23.         System.out.println((int) playCount);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment