Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int count;
- cin >> count;
- string size;
- cin >> size;
- cin.ignore();
- string delivery;
- getline(cin, delivery);
- double price, discountPercentage, totalPrice;
- if (count <= 10) {
- cout << "Invalid order\n";
- }
- else {
- if (size == "90X130") {
- price = 110;
- if (count > 60) {
- discountPercentage = 8;
- }
- else if (count > 30) {
- discountPercentage = 5;
- }
- }
- else if (size == "100X150") {
- price = 140;
- if (count > 80) {
- discountPercentage = 10;
- }
- else if (count > 40) {
- discountPercentage = 6;
- }
- }
- else if (size == "130X180") {
- price = 190;
- if (count > 50) {
- discountPercentage = 12;
- }
- else if (count > 20) {
- discountPercentage = 7;
- }
- }
- else if (size == "200X300") {
- price = 250;
- if (count > 50) {
- discountPercentage = 14;
- }
- else if (count > 25) {
- discountPercentage = 9;
- }
- }
- totalPrice = price * count * ((100 - discountPercentage) / 100);
- if (delivery == "With delivery") {
- totalPrice += 60;
- }
- if (count > 99) {
- totalPrice *= 0.96;
- }
- printf("%.2f BGN\n", totalPrice);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement