Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. int tableQuantity;
  9. double length, width;
  10. cin >> tableQuantity;
  11. cin >> length;
  12. cin >> width;
  13.  
  14.  
  15. double usd, bgn;
  16.  
  17. double areaTableCloth = tableQuantity * (length + 2 * 0.3) * (width + 2 * 0.3);
  18. double areaTableSquare = tableQuantity * (length / 2) * (length / 2);
  19.  
  20. usd = (7 * areaTableCloth) + (9 * areaTableSquare);
  21. bgn = usd * 1.85;
  22.  
  23. cout.setf(ios::fixed);
  24. cout.precision(2);
  25.  
  26. cout << usd << " USD" << endl;
  27. cout << bgn << " BGN" << endl;
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement