Nephelir

Untitled

Jan 28th, 2020
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. //output Ако бюджета е достатъчен - "Hey, you have a great garden with << flowersNumber << " " << flowers << " and " << ...
  8. int main()
  9. {
  10. string flowers;
  11. int flowersNumber;
  12. int budget;
  13.  
  14. cin >> flowers >> flowersNumber >> budget;
  15.  
  16. double flowerPrice = 0.0;
  17. double discount = 0.0;
  18. int roses;
  19.  
  20.  
  21. if (flowers == "Roses")
  22. flowerPrice = 5;
  23. else if (flowers == "Dahlias")
  24. flowerPrice = 3.80;
  25. else if (flowers == "Tulips")
  26. flowerPrice = 2.80;
  27. else if (flowers == "Narcissus")
  28. flowerPrice = 3;
  29. else if (flowers == "Gladious")
  30. flowerPrice = 2.50;
  31.  
  32. if (flowers == "Roses" && roses >= 80)
  33. discount = flowerPrice * 0.2;
  34.  
  35.  
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment