Advertisement
Spocoman

Cat Expenses

Sep 15th, 2023
810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double bedPrice, toiletPrice;
  8.     cin >> bedPrice >> toiletPrice;
  9.  
  10.     double foodPrice = toiletPrice * 1.25;
  11.     double toyPrice = foodPrice / 2;
  12.     double vetPrice = toyPrice * 1.1;
  13.     double sum = (toiletPrice + foodPrice + toyPrice + vetPrice) * 12 * 1.05 + bedPrice;
  14.  
  15.     printf("%.2f\n", sum);
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement