Advertisement
Spocoman

06. Fishland

Sep 1st, 2023 (edited)
596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double mackerelPrice, spratPrice, bonitoFishKg, saffronKg, shellKg;
  7.     cin >> mackerelPrice >> spratPrice >> bonitoFishKg >> saffronKg >> shellKg;
  8.  
  9.     double bonitoFishSum = bonitoFishKg * mackerelPrice * 1.60;
  10.     double saffronSum = saffronKg * spratPrice * 1.80;
  11.     double shellSum = shellKg * 7.50;
  12.     double totalPrice = bonitoFishSum + saffronSum + shellSum;
  13.    
  14.     cout.setf(ios::fixed);
  15.     cout.precision(2);
  16.  
  17.     cout << totalPrice << endl;
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement