Advertisement
DidiMilikina

Untitled

Oct 1st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.     string product, town;
  7.     double quantity;
  8.     cin >> product >> town >> quantity;
  9.  
  10.     if (town == "Sofia")
  11.     {
  12.         if (product == "coffee") cout << quantity * 0.5 << endl;
  13.         else if (product == "water") cout << quantity * 0.8 << endl;
  14.         // TODO: Check the other products ...
  15.     }
  16.     if (town == "Varna")
  17.     {
  18.         if (product == "coffee") cout << quantity * 0.45 << endl;
  19.         else if (product == "water") cout << quantity * 0.7 << endl;
  20.         // TODO: Check the other products ...
  21.     }
  22.     if (town == "Plovdiv")
  23.     {
  24.         if (product == "coffee") cout << quantity * 0.4 << endl;
  25.         else if (product == "water") cout << quantity * 0.7 << endl;
  26.         // TODO: Check the other products ...
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement