Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int const sa = 8;
- int const sb = 5;
- double length1 (int sa);
- double length2 (int sb);
- double totlength (double length1, double length2);
- int main()
- {
- int hw1 = 8;
- int hw2 = 5;
- double p1;
- double p2;
- double total;
- p1 = length1 (hw1);
- p2 = length2 (hw2);
- total = p1 + p2;
- cout << "There are two hallways with widths of 8 Ft and 5 Ft." << endl;
- cout << "The longest pipe that can turn the corner of the two hallways" << endl;
- cout << " is " << total << " Ft long." << endl;
- return 0;
- }
- double length1 (int sa){
- double p1;
- double sec = 1.9035944074;
- p1 = sa * sec;
- return p1;
- }
- double length2 (int sb){
- double p2;
- double csc = 1.17522136314;
- p2 = sb * csc;
- return p2;
- }
- double totlength(double length1, double length2){
- double total;
- total = length1 + length2;
- return total;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement