Advertisement
veronikaaa86

Volleyball

Sep 30th, 2017
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 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 leapOrNormal = scanner.nextLine();
  8.         int holidayYear = Integer.parseInt(scanner.nextLine());
  9.         int weekendsHome = Integer.parseInt(scanner.nextLine());
  10.  
  11.         int weekendSofia = 48-weekendsHome;
  12.         double saturdayGamesSofia = weekendSofia*(3.0/4.0);
  13.         double holidayGamesSofia = holidayYear*(2.0/3.0);
  14.         double allGame = saturdayGamesSofia+holidayGamesSofia+weekendsHome;
  15.  
  16.         if ("leap".equals(leapOrNormal)) {
  17.             allGame += allGame*0.15;
  18.         }
  19.         System.out.printf("%.0f", Math.floor(allGame));
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement