Advertisement
Guest User

Untitled

a guest
Sep 20th, 2014
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. float fency_price(float l, float c)
  6. {
  7.     float perimeter = 4.0*l;
  8.     float result = perimeter*c;
  9.     return result;
  10. }
  11.  
  12. int main()
  13. {
  14.    float side_length, fence_cost, total_price;        
  15.    
  16.    cout << "input fency's side length and fence cost";
  17.    cin >> side_length >> fence_cost;
  18.    
  19.    total_price = fency_price(side_length, fence_cost);
  20.    
  21.    cout << "sad old man will pay for that " << total_price;  
  22.    return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement