Advertisement
valkata

Untitled

Mar 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Volleyball {
  4. public static void main(String[] args) {
  5. Scanner console= new Scanner(System.in);
  6. String year = console.nextLine();
  7. double p = Double.parseDouble(console.nextLine());
  8. double h = Double.parseDouble(console.nextLine());
  9. double sofia = (48 - h) * 3/4 ;
  10. double holiday = p * 2/3;
  11. double total = sofia + h + holiday;
  12. double leap = total * 15/100;
  13. double total0 = total + leap;
  14.  
  15. if (year.equals("leap")){
  16. System.out.println(Math.floor(total0));
  17. }else if(year.equals("normal")){
  18. System.out.println(Math.floor(total));
  19. }
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement