Advertisement
YavorGrancharov

Volleyball

Jan 22nd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Volleyball {
  4.     public static void main(String[] args) {
  5.         Scanner console = new Scanner(System.in);
  6.         String year = console.nextLine();
  7.         int p = Integer.parseInt(console.nextLine());
  8.         int h = Integer.parseInt(console.nextLine());
  9.  
  10.         double sofia = (48 - h) * (3.0/4);
  11.         double holiday = (p * (2.0/3));
  12.         double games = sofia + holiday + h;
  13.         double leap = (games * 0.15) + games;
  14.  
  15.  
  16.         if (year.equals("normal")) {
  17.             System.out.println(Math.floor(games));
  18.         } else if (year.equals("leap")) {
  19.             System.out.println(Math.floor(leap));
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement