Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E12Volleyball2{
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String year = scanner.nextLine();
- int holidaysP = Integer.parseInt(scanner.nextLine());
- int weekendsHomeH = Integer.parseInt(scanner.nextLine());
- double playSofia = (48 - weekendsHomeH) * 3 / 4.0 + (holidaysP * 2 / 3.0);
- double playHome = weekendsHomeH;
- double playTotal = 0;
- switch (year) {
- case "normal":
- playTotal = Math.floor(playSofia + playHome);
- break;
- }
- switch (year) {
- case "leap":
- playTotal = Math.floor((playSofia + playHome) * 1.15);
- break;
- }
- System.out.printf("%.0f", playTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement