Advertisement
Guest User

Untitled

a guest
May 11th, 2017
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4. * Created by Ivan on 5/7/2017.
  5. */
  6. public class TaskTwo {
  7. public static void main(String[] args) {
  8. Scanner scanner = new Scanner(System.in);
  9. double priceVacantion = Double.parseDouble(scanner.nextLine());
  10. int numberPuzzel = Integer.parseInt(scanner.nextLine());
  11. int numberKukli = Integer.parseInt(scanner.nextLine());
  12. int numberBears = Integer.parseInt(scanner.nextLine());
  13. int numberMinions = Integer.parseInt(scanner.nextLine());
  14. int numberTruck = Integer.parseInt(scanner.nextLine());
  15.  
  16. double prisePuzzel = numberPuzzel * 2.60;
  17. double priseKukli = numberKukli * 3.0;
  18. double priseBears = numberBears * 4.1;
  19. double priseMinions = numberMinions * 8.20;
  20. double priceTruck = numberTruck * 2.0;
  21.  
  22. double priceGames = prisePuzzel + priseKukli + priseBears + priseMinions + priceTruck;
  23. int sumGames = numberPuzzel + numberKukli + numberBears + numberMinions + numberTruck;
  24.  
  25. if (sumGames >= 50){
  26. double priceFee = priceGames * 0.75;
  27. double withNaem = priceFee * 0.9;
  28. System.out.printf("Yes! %.2f", (withNaem - priceVacantion));
  29. System.out.println(" lv left.");
  30. }
  31. else{
  32. // double priceFee = priceGames * 1.0;
  33. double withNaem = priceGames * 0.9;
  34. System.out.printf("Not enough money! %.2f", (priceVacantion - withNaem));
  35. System.out.println(" lv needed.");
  36. }
  37.  
  38.  
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement