Advertisement
SIRAKOV4444

Untitled

Mar 25th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Exe2 {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double Vacation = Double.parseDouble(scanner.nextLine());
  8.  
  9. double puzzles = Double.parseDouble(scanner.nextLine());
  10. double dolls = Double.parseDouble(scanner.nextLine());
  11. double teddy = Double.parseDouble(scanner.nextLine());
  12. double minions = Double.parseDouble(scanner.nextLine());
  13. double trucks = Double.parseDouble(scanner.nextLine());
  14.  
  15. double Profit = puzzles * 2.60 + dolls * 3 + teddy * 4.10 + minions * 8.20 + trucks * 2;
  16. double TotalNumbers = puzzles + dolls + teddy + minions + trucks;
  17.  
  18.  
  19. double case1 = 0.00;
  20. if (TotalNumbers >= 50) {
  21. case1 = Profit * 0.75;
  22. }
  23. double Total = case1 * 0.90;
  24. if (Vacation <= Total) {
  25. System.out.printf("Yes! %.2f lv left.", Total - Vacation);
  26. } else {
  27. System.out.printf("Not enough money! %.2f lv needed.", Math.abs(Total - Vacation));
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement