Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- double currentPrice = 0.00;
- double singlePrice;
- int windowNumber;
- cin >> windowNumber;
- string windowType;
- cin >> windowType;
- string deliveryType;
- cin.ignore();
- getline(cin, deliveryType);
- if (windowNumber <= 10)
- {
- cout << "Invalid order" << endl;
- }
- else
- {
- if (windowType == "90X130")
- {
- singlePrice = 110.00;
- currentPrice = singlePrice * windowNumber;
- if (windowNumber > 30 && windowNumber <= 60)
- {
- currentPrice = currentPrice * 0.95;
- }
- else if (windowNumber > 60)
- {
- currentPrice = currentPrice * 0.92;
- }
- if (deliveryType == "With delivery")
- {
- currentPrice += 60.00;
- }
- if (windowNumber > 99)
- {
- currentPrice *= 0.96;
- }
- }
- else if (windowType == "100X150")
- {
- singlePrice = 140.00;
- currentPrice = singlePrice * windowNumber;
- if (windowNumber > 40 && windowNumber <= 80)
- {
- currentPrice = currentPrice * 0.94;
- }
- else if (windowNumber > 80)
- {
- currentPrice = currentPrice * 0.90;
- }
- if (deliveryType == "With delivery")
- {
- currentPrice += 60.00;
- }
- if (windowNumber > 99)
- {
- currentPrice *= 0.96;
- }
- }
- else if (windowType == "130X180")
- {
- singlePrice = 190.00;
- currentPrice = singlePrice * windowNumber;
- if (windowNumber > 20 && windowNumber <= 50)
- {
- currentPrice = currentPrice * 0.93;
- }
- else if (windowNumber > 50)
- {
- currentPrice = currentPrice * 0.88;
- }
- if (deliveryType == "With delivery")
- {
- currentPrice += 60.00;
- }
- if (windowNumber > 99)
- {
- currentPrice *= 0.96;
- }
- }
- else if (windowType == "200X300")
- {
- singlePrice = 250.00;
- currentPrice = singlePrice * windowNumber;
- if (windowNumber > 25 && windowNumber <= 50)
- {
- currentPrice = currentPrice * 0.91;
- }
- else if (windowNumber > 50)
- {
- currentPrice = currentPrice * 0.86;
- }
- if (deliveryType == "With delivery")
- {
- currentPrice += 60.00;
- }
- if (windowNumber > 99)
- {
- currentPrice *= 0.96;
- }
- }
- cout.setf(ios::fixed);
- cout.precision(2);
- cout << currentPrice << " BGN" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement