aneliabogeva

Volleyball

Nov 12th, 2020
666
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×