Advertisement
Guest User

Untitled

a guest
May 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class IfElse {
  4. public static void main(String[] args) {
  5. Scanner scan = new Scanner(System.in);
  6.  
  7. String year = scan.nextLine();
  8. double koleda = Double.parseDouble(scan.nextLine());
  9. double weekendSelo = Double.parseDouble(scan.nextLine());
  10.  
  11. double weekendSofia = 48 - weekendSelo;
  12. double playsSofia = weekendSofia * 3/4;
  13. double playsSelo = weekendSelo;
  14. double playsKoleda = koleda * 2/3;
  15.  
  16. if (year.equals("normal")) {
  17. double allPLays = (playsKoleda + playsSelo+playsSofia);
  18.  
  19. System.out.println(Math.floor(allPLays));
  20.  
  21. } else if(year.equals("leap")){
  22. double allPlays = playsKoleda+playsSelo+playsSofia;
  23. double percent = allPlays * 15 /100;
  24.  
  25. System.out.println(Math.floor(allPlays + percent));
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement