Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Volleyball_09 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String year = scanner.nextLine();
- int holidaysCount = Integer.parseInt(scanner.nextLine());
- int weekendsHome = Integer.parseInt(scanner.nextLine());
- double holidaysPlays = holidaysCount * (2.0 / 3.0);
- double playsSofia = ((48 - weekendsHome) * (3.0 / 4.0)) + holidaysPlays;
- double totalPlays = playsSofia + weekendsHome;
- if (year.equals("leap")) {
- totalPlays *= 1.15;
- }
- System.out.printf("%f", Math.floor(totalPlays));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement