Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- using namespace std;
- // Aluminium Joinery
- int main()
- {
- string s;
- getline(cin, s);
- int count = stoi(s);
- string type;
- getline(cin, type);
- string way;
- getline(cin, way);
- double price;
- if (type == "90X130")
- {
- if (count > 60)
- {
- price = 110 * 0.92;
- }
- else if (count > 30)
- {
- price = 110 * 0.95;
- }
- else if (count >= 10)
- {
- price = 110;
- }
- else
- {
- printf("Invalid order\n");
- return 0;
- }
- }
- if (type == "100X150")
- {
- if (count > 80)
- {
- price = 140 * 0.9;
- }
- else if (count > 40)
- {
- price = 140 * 0.94;
- }
- else if (count >= 10)
- {
- price = 140;
- }
- else
- {
- printf("Invalid order\n");
- return 0;
- }
- }
- if (type == "130X180")
- {
- if (count > 50)
- {
- price = 190 * 0.88;
- }
- else if (count > 20)
- {
- price = 190 * 0.93;
- }
- else if (count >= 10)
- {
- price = 190;
- }
- else
- {
- printf("Invalid order\n");
- return 0;
- }
- }
- if (type == "200X300")
- {
- if (count > 50)
- {
- price = 250 * 0.86;
- }
- else if (count > 25)
- {
- price = 250 * 0.91;
- }
- else if (count >= 10)
- {
- price = 250;
- }
- else
- {
- printf("Invalid order\n");
- return 0;
- }
- }
- price = price * count;
- if (way == "With delivery")
- {
- price = price + 60;
- }
- if (count > 99)
- {
- price = price * 0.96;
- }
- printf("%.2f BGN\n", price);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement