Advertisement
Spocoman

Easter Bakery

Sep 17th, 2023
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     double flourKg, flourPrice, sugarKg, eggPack, yeast;
  8.     cin >> flourKg >> flourPrice >> sugarKg >> eggPack >> yeast;
  9.  
  10.     double flourTotal = flourKg * flourPrice;
  11.     double sugarTotal = flourKg * sugarKg * 0.75;
  12.     double eggPackTotal = flourKg * eggPack * 1.1;
  13.     double yeastTotal = flourKg * 0.75 * yeast * 0.2;
  14.     double sum = flourTotal + sugarTotal + eggPackTotal + yeastTotal;
  15.    
  16.     printf("%.2f\n", sum);
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement