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 leapN = scanner.nextLine();
- double praznici = Double.parseDouble(scanner.nextLine());
- int home = Integer.parseInt(scanner.nextLine());
- int sofWeek = 48 - home;
- double SaturdayPlaySof = (sofWeek * 0.75);
- double prazniciPlaySof = (praznici * 0.666666667);
- double totalPlaysSofHome = SaturdayPlaySof + home + prazniciPlaySof;
- if (leapN.equals("leap"))
- {
- double leapYear = (totalPlaysSofHome * 15) / 100;
- double leapYearPlays = totalPlaysSofHome + leapYear;
- System.out.println(Math.floor(leapYearPlays));
- }
- else
- {
- System.out.println(Math.floor(totalPlaysSofHome));
- }
- }
- }
Add Comment
Please, Sign In to add comment