Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package advancedConditionalStatements;
- import java.util.Scanner;
- public class P09Volleyball {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String leapOrNormal = scanner.nextLine();
- int countHolidays = Integer.parseInt(scanner.nextLine());
- int countWeekendsHome = Integer.parseInt(scanner.nextLine());
- double saturdayGames = (48 - countWeekendsHome) * 3.0 / 4;
- double holidaysGames = countHolidays * 2 / 3.0;
- double allGames = saturdayGames + countWeekendsHome + holidaysGames;
- if (leapOrNormal.equals("leap")) {
- allGames = allGames * 1.15;
- }
- System.out.printf("%.0f", Math.floor(allGames));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement