Advertisement
Venciity

[SoftUni Java] ExamPreparation 01.Voleyball

May 20th, 2014
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Program {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner input = new Scanner(System.in);
  7.         String leap = input.next();
  8.         int holidaysCount = input.nextInt();
  9.         int weekendsHomeCount = input.nextInt();
  10.        
  11.         int weekendsInYear = 48;
  12.        
  13.         int normalWeekends = weekendsInYear - weekendsHomeCount;
  14.         double gamesCount =
  15.                 normalWeekends * 3.0/4.0 +
  16.                 weekendsHomeCount * 1.0 +
  17.                 holidaysCount * 2.0/3.0;
  18.        
  19.         if (leap.equals("leap")) {
  20.             gamesCount = gamesCount * 1.15;
  21.         }
  22.         System.out.println((int)gamesCount);
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement