Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Volleyball {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6.  
  7. String year = sc.nextLine(); //leap, normal
  8. int holidays = Integer.parseInt(sc.nextLine());
  9. int weekends = Integer.parseInt(sc.nextLine());
  10.  
  11. double sofiaPlays1 = (48 - weekends) * 3 / 4.0;
  12. double sofiaPlays2 = holidays * 2.0 / 3;
  13. double totalPlay = weekends + sofiaPlays1 + sofiaPlays2;
  14.  
  15. if (year.equals("leap")) {
  16. totalPlay += 0.15 * totalPlay;
  17. }
  18.  
  19. System.out.println(Math.floor(totalPlay));
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement