Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Volleyball_09 {
  4.  
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7.  
  8. String year = scanner.nextLine();
  9. int holidaysCount = Integer.parseInt(scanner.nextLine());
  10. int weekendsHome = Integer.parseInt(scanner.nextLine());
  11.  
  12. double holidaysPlays = holidaysCount * (2.0 / 3.0);
  13. double playsSofia = ((48 - weekendsHome) * (3.0 / 4.0)) + holidaysPlays;
  14. double totalPlays = playsSofia + weekendsHome;
  15.  
  16. if (year.equals("leap")) {
  17. totalPlays *= 1.15;
  18. }
  19.  
  20. System.out.printf("%f", Math.floor(totalPlays));
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement