aneliabogeva

Volleyball

Dec 13th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 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.         String typeYear = scanner.nextLine();
  7.         Integer holidaysNotWeekend = Integer.parseInt(scanner.nextLine());
  8.         Integer weekendHomeTown = Integer.parseInt(scanner.nextLine());
  9.         Double weekendInSofia = (48-weekendHomeTown)*0.75;
  10.         Integer holidaysInSofia = holidaysNotWeekend*2/3;
  11.         Double totalGames = weekendInSofia+weekendHomeTown+holidaysInSofia;
  12.         Double finalGames = 0.00;
  13.  
  14.  
  15.         if("leap".equals(typeYear)){
  16.             finalGames = totalGames + totalGames*0.15;
  17.  
  18.         }else if("normal".equals(typeYear)){
  19.             finalGames = Double.valueOf(totalGames);
  20.         }else{}
  21.  
  22.         System.out.println(Math.round(finalGames));
  23.     }
  24. }
  25.  
Add Comment
Please, Sign In to add comment