Advertisement
MladenKarachanov

AluminumJoinery

Oct 1st, 2023
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.06 KB | None | 0 0
  1. package ProgrammingBasics2;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class AluminumJoinery {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         int numberOfDogmas = Integer.parseInt(scanner.nextLine());
  9.         String typeOfJoinery = scanner.nextLine();
  10.         String shipmentMethod = scanner.nextLine();
  11.         double discount = 0;
  12.         int price = 0;
  13.         if (typeOfJoinery.equals("90*130")) {
  14.             price = 110;
  15.             if (numberOfDogmas > 30) {
  16.                 discount = price - (price * 0.05);
  17.             }
  18.             if (numberOfDogmas > 60) {
  19.               //  price = 110;
  20.                 discount = price - (price * 0.08);
  21.  
  22.             }
  23.  
  24.         } else if (typeOfJoinery.equals("100*150")) {
  25.             price = 140;
  26.             if (numberOfDogmas > 40) {
  27.                 discount = price - (price * 0.06);
  28.  
  29.             }
  30.             if (numberOfDogmas > 80) {
  31.                 discount = price - (price * 0.10);
  32.  
  33.             }
  34.            
  35.         } else if (typeOfJoinery.equals("130*180")) {
  36.             price = 190;
  37.             if (numberOfDogmas > 20) {
  38.                 discount = price - (price * 0.07);
  39.             }
  40.             if (numberOfDogmas > 50) {
  41.                 discount = price - (price * 0.12);
  42.             }
  43.         } else if (typeOfJoinery.equals("200*300")) {
  44.             price = 250;
  45.             if (numberOfDogmas > 25) {
  46.                 discount = price - (price * 0.09);
  47.             }
  48.         } else if (numberOfDogmas > 50) {
  49.             price = 250;
  50.             discount = price - (price * 0.14);
  51.         }
  52.  
  53.         if (numberOfDogmas > 99) {
  54.             discount = price - (price * 0.04);
  55.         }
  56.             if (shipmentMethod.equals("With delivery")) {
  57.                 price += 60;
  58.         }
  59.         double finish = price * discount;
  60.  
  61.         if (numberOfDogmas <= 10) {
  62.             System.out.println("Invalid order");
  63.         } else {
  64.             System.out.printf("%.2f BGN", finish);
  65.         }
  66.     }
  67. }
  68.  
  69. //НЕ Е РЕШЕНА
  70.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement