Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E12Volleyball {
- 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;
- if (year.equalsIgnoreCase("normal")){
- playTotal = Math.floor(playSofia + playHome);
- }
- else if (year.equalsIgnoreCase("leap")){
- playTotal = Math.floor((playSofia + playHome) * 1.15); //+ 15%
- }
- System.out.printf("%.0f", playTotal);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement