Advertisement
Sim0o0na

Untitled

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