Advertisement
Spocoman

04. Vegetable Market

Sep 1st, 2023 (edited)
556
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double vegetablePrice, fruitPrice, vegetableQuantity, fruitQuantity;
  7.     cin >> vegetablePrice >> fruitPrice >> vegetableQuantity >> fruitQuantity;
  8.     double totalPrice = (vegetablePrice * vegetableQuantity + fruitPrice * fruitQuantity) / 1.94;
  9.  
  10.     cout.setf(ios::fixed);
  11.     cout.precision(2);
  12.    
  13.     cout << totalPrice << endl;
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement