Advertisement
alexpeevk9

03. Aluminum Joinery

Feb 13th, 2022
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.24 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     double currentPrice = 0.00;
  8.     double singlePrice;
  9.     int windowNumber;
  10.     cin >> windowNumber;
  11.     string windowType;
  12.     cin >> windowType;
  13.     string deliveryType;
  14.     cin.ignore();
  15.     getline(cin, deliveryType);
  16.  
  17.     if (windowNumber <= 10)
  18.     {
  19.         cout << "Invalid order" << endl;
  20.     }
  21.     else
  22.     {
  23.         if (windowType == "90X130")
  24.         {
  25.             singlePrice = 110.00;
  26.             currentPrice = singlePrice * windowNumber;
  27.             if (windowNumber > 30 && windowNumber <= 60)
  28.             {
  29.                 currentPrice = currentPrice * 0.95;
  30.             }
  31.             else if (windowNumber > 60)
  32.             {
  33.                 currentPrice = currentPrice * 0.92;
  34.             }
  35.  
  36.             if (deliveryType == "With delivery")
  37.             {
  38.                 currentPrice += 60.00;
  39.             }
  40.  
  41.             if (windowNumber > 99)
  42.             {
  43.                 currentPrice *= 0.96;
  44.             }
  45.         }
  46.         else if (windowType == "100X150")
  47.         {
  48.             singlePrice = 140.00;
  49.             currentPrice = singlePrice * windowNumber;
  50.             if (windowNumber > 40 && windowNumber <= 80)
  51.             {
  52.                 currentPrice = currentPrice * 0.94;
  53.             }
  54.             else if (windowNumber > 80)
  55.             {
  56.                 currentPrice = currentPrice * 0.90;
  57.             }
  58.  
  59.             if (deliveryType == "With delivery")
  60.             {
  61.                 currentPrice += 60.00;
  62.             }
  63.  
  64.             if (windowNumber > 99)
  65.             {
  66.                 currentPrice *= 0.96;
  67.             }
  68.         }
  69.         else if (windowType == "130X180")
  70.         {
  71.             singlePrice = 190.00;
  72.             currentPrice = singlePrice * windowNumber;
  73.             if (windowNumber > 20 && windowNumber <= 50)
  74.             {
  75.                 currentPrice = currentPrice * 0.93;
  76.             }
  77.             else if (windowNumber > 50)
  78.             {
  79.                 currentPrice = currentPrice * 0.88;
  80.             }
  81.  
  82.             if (deliveryType == "With delivery")
  83.             {
  84.                 currentPrice += 60.00;
  85.             }
  86.  
  87.             if (windowNumber > 99)
  88.             {
  89.                 currentPrice *= 0.96;
  90.             }
  91.         }
  92.         else if (windowType == "200X300")
  93.         {
  94.             singlePrice = 250.00;
  95.             currentPrice = singlePrice * windowNumber;
  96.             if (windowNumber > 25 && windowNumber <= 50)
  97.             {
  98.                 currentPrice = currentPrice * 0.91;
  99.             }
  100.             else if (windowNumber > 50)
  101.             {
  102.                 currentPrice = currentPrice * 0.86;
  103.             }
  104.  
  105.             if (deliveryType == "With delivery")
  106.             {
  107.                 currentPrice += 60.00;
  108.             }
  109.  
  110.             if (windowNumber > 99)
  111.             {
  112.                 currentPrice *= 0.96;
  113.             }
  114.         }
  115.         cout.setf(ios::fixed);
  116.         cout.precision(2);
  117.         cout << currentPrice << " BGN" << endl;
  118.     }
  119.  
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement