Advertisement
Spocoman

Bracelet Stand

Sep 15th, 2023
634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double dayCash, dayProfit, cost, giftPrice;
  8.     cin >> dayCash >> dayProfit >> cost >> giftPrice;
  9.  
  10.     double total = (dayCash + dayProfit) * 5 - cost;
  11.  
  12.     if (total >= giftPrice) {
  13.         printf("Profit: %.2f BGN, the gift has been purchased.", total);
  14.     }
  15.     else {
  16.         printf("Insufficient money: %.2f BGN.", giftPrice - total);
  17.     }
  18.    
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement