Advertisement
DidiMilikina

03. Photo Pictures

Oct 31st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.12 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int count_of_photos;
  10.     string type_of_photo;
  11.     string type_of_order;
  12.     cin >> count_of_photos
  13.         >> type_of_photo
  14.         >> type_of_order;
  15.     double total_cost = 0.0;
  16.  
  17.     if (type_of_photo == "9X13")
  18.     {
  19.         total_cost = count_of_photos * 0.16;
  20.         if (count_of_photos >= 50)
  21.         {
  22.             total_cost *= 0.95;
  23.         }
  24.     }
  25.     else if (type_of_photo == "10X15")
  26.     {
  27.         total_cost = count_of_photos * 0.16;
  28.         if (count_of_photos >= 80)
  29.         {
  30.             total_cost *= 0.97;
  31.         }
  32.     }
  33.     else if (type_of_photo == "13X18")
  34.     {
  35.         total_cost = count_of_photos * 0.38;
  36.         if (count_of_photos > 100)
  37.         {
  38.             total_cost *= 0.95;
  39.         }
  40.         else if (count_of_photos >= 50)
  41.         {
  42.             total_cost *= 0.97;
  43.         }
  44.     }
  45.     else if (type_of_photo == "20X30")
  46.     {
  47.         total_cost = count_of_photos * 2.9;
  48.         if (count_of_photos > 50)
  49.         {
  50.             total_cost *= 0.91;
  51.         }
  52.         else if (count_of_photos >= 10)
  53.         {
  54.             total_cost *= 0.93;
  55.         }
  56.     }
  57.    
  58.     if (type_of_order == "online")
  59.     {
  60.         total_cost *= 0.98;
  61.     }
  62.  
  63.     cout << fixed << setprecision(2) << total_cost << "BGN" << endl;
  64.  
  65.     return 0;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement