Problem requires TRIGONOMETRY: A pipe is to be carried around the right-angled corner of two intersecting corridors. Suppose that the widths of the two intersecting corridors are 5 feet and 8 feet (see below figure). Your objective is to find the length of the longest pipe, rounded to the nearest foot, that can be carried level around the right-angled corner.
Write a program that prompts the user to input the widths of both of the hallways. The program then outputs the length of the longest pipe, rounded to the nearest foot, that can be carried level around the right-angled corner. (Note that the length of the pipe is given by l = AB + BC = 8 / sin

jwenting commented: lazy homework kiddo... -3

## All 3 Replies

good luck with your homework.

Note that you need to take the diameter of the pipe into consideration, not just the length.
And that the pipe probably should not hit the walls to prevent damage.

Please help me get the right codes for c plus plus i need it right now

Assuming you aren't being required to write your own trig functions - a daunting task - then the functions you want are in the legacy C library header, <cmath>. That's about as much assistance as we can give, however, until you have demonstrated some effort on your own part.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.