Advertisement
DidiMilikina

01. Tailoring Workshop

Oct 31st, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int number_of_tables;
  9.     double width_of_table;
  10.     double height_of_table;
  11.  
  12.     cin >> number_of_tables >> height_of_table >> width_of_table;
  13.     double area_of_coverage = number_of_tables * (width_of_table + 2 * 0.3) * (height_of_table + 2 * 0.3);
  14.     double area_of_kare = number_of_tables * (height_of_table / 2) * (height_of_table / 2);
  15.     double total_price_in_dollars = area_of_coverage * 7 + area_of_kare * 9;
  16.     double total_price_in_leva = total_price_in_dollars * 1.85;
  17.  
  18.     cout << fixed << setprecision(2) << total_price_in_dollars << " USD" << endl;
  19.     cout << fixed << setprecision(2) << total_price_in_leva << " BGN" << endl;
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement