Advertisement
desislava_topuzakova

Untitled

Sep 30th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class AluminumJoinery {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int countWindows = Integer.parseInt(scanner.nextLine());
  8. String typeWindow = scanner.nextLine();
  9. String delivery = scanner.nextLine();
  10.  
  11. double price = 0;
  12. if (countWindows < 10) {
  13. System.out.println("Invalid order");
  14. return;
  15. } else {
  16. if (typeWindow.equals("90X130")) {
  17. price = countWindows * 110.0;
  18. if (countWindows > 30 && countWindows <= 60){
  19. price = price * 0.95;
  20. } else if (countWindows > 60){
  21. price = price * 0.92;
  22. }
  23. } else if (typeWindow.equals("100X150")) {
  24. price = countWindows * 140.0;
  25. if (countWindows > 40 && countWindows <= 80){
  26. price = price * 0.94;
  27. } else if (countWindows > 80){
  28. price = price * 0.90;
  29. }
  30. } else if (typeWindow.equals("130X180")) {
  31. price = countWindows * 190.0;
  32. if (countWindows > 20 && countWindows <= 50){
  33. price = price * 0.93;
  34. } else if (countWindows > 50){
  35. price = price * 0.88;
  36. }
  37. } else if (typeWindow.equals("200X300")) {
  38. price = countWindows * 250.0;
  39. if (countWindows > 25 && countWindows <= 50){
  40. price = price * 0.91;
  41. } else if (countWindows > 50){
  42. price = price * 0.86;
  43. }
  44. }
  45. }
  46.  
  47. if (delivery.equals("With delivery")){
  48. price = price + 60;
  49. }
  50.  
  51. if (countWindows > 99){
  52. price = price * 0.96;
  53. }
  54.  
  55. System.out.printf("%.2f BGN", price);
  56. }
  57. }
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement