Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Volleyball {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String typeYear = scanner.nextLine();
- Integer holidaysNotWeekend = Integer.parseInt(scanner.nextLine());
- Integer weekendHomeTown = Integer.parseInt(scanner.nextLine());
- Double weekendInSofia = (48-weekendHomeTown)*0.75;
- Integer holidaysInSofia = holidaysNotWeekend*2/3;
- Double totalGames = weekendInSofia+weekendHomeTown+holidaysInSofia;
- Double finalGames = 0.00;
- if("leap".equals(typeYear)){
- finalGames = totalGames + totalGames*0.15;
- }else if("normal".equals(typeYear)){
- finalGames = Double.valueOf(totalGames);
- }else{}
- System.out.println(Math.round(finalGames));
- }
- }
Add Comment
Please, Sign In to add comment