Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5. int const sa = 8;
  6. int const sb = 5;
  7. double length1 (int sa);
  8. double length2 (int sb);
  9. double totlength (double length1, double length2);
  10. int main()
  11. {
  12. int hw1 = 8;
  13. int hw2 = 5;
  14. double p1;
  15. double p2;
  16. double total;
  17.  
  18. p1 = length1 (hw1);
  19. p2 = length2 (hw2);
  20. total = p1 + p2;
  21. cout << "There are two hallways with widths of 8 Ft and 5 Ft." << endl;
  22. cout << "The longest pipe that can turn the corner of the two hallways" << endl;
  23. cout << " is " << total << " Ft long." << endl;
  24.  
  25.  
  26. return 0;
  27. }
  28. double length1 (int sa){
  29. double p1;
  30. double sec = 1.9035944074;
  31. p1 = sa * sec;
  32. return p1;
  33.  
  34. }
  35. double length2 (int sb){
  36. double p2;
  37. double csc = 1.17522136314;
  38. p2 = sb * csc;
  39. return p2;
  40.  
  41. }
  42. double totlength(double length1, double length2){
  43. double total;
  44. total = length1 + length2;
  45. return total;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement