# Understand the algorithm in the procedure main 6 do

• goraudchristine
• 11

This preview shows page 3 - 5 out of 11 pages.

5. Understand the algorithm in the procedure main().6. Do NOT add more functions to the solution.7. Each function should have a comment explaining what it does.8. Each function parameter should have a comment explaining the parameter.9. Write code by replacing every place /* INSERT CODE HERE */ appears with your solution.10. Implement the get and set member functions for the classTriangle. Use the appropriate classattributes of the class Triangle.a. The location of the bottom left vertex is stored in the member attribute blPoint.b. The top left vertex can be computed from blPoint and the height.c. The bottom right vertex can be computed from blPoint andthe length.11. You may assume that the user will enter positive values for the length and height.12. Implement the member function hypotenuse() of the class Triangle that computes thehypotenuse of a triangle object. Use the Pythagorean Theorem to compute the length of theside of the triangle opposite to the right angle. Use the appropriate class attribute(s) of theclass Triangle.13. Implement the member function perimeter() of the class Triangle that computes the
perimeter of the triangle object. Sum all three sides of the triangle. Use the appropriate classattribute(s) of the class Triangle and the member function hypotenuse().14. Implement the member function scaleLength() of the class Triangle that computes the newvalue of the length as the current length weighted by the scale factor in the x direction. Forexample, if the current length is 2 and the scale factor is 3, the new length is 6. If the currentlength is 2 and the scale factor is 0.5, the new length is 1. You may assume that the scale
• • • 