Answered step by step
Verified Expert Solution
Question
1 Approved Answer
5. Write a C++ program that will calculate the perimeter and area of a right triangle. You must use three functions: (i) Function calculate
5. Write a C++ program that will calculate the perimeter and area of a right triangle. You must use three functions: (i) Function calculate Perimeter to calculate the perimeter of the triangle and returns the perimeter value. (ii) Function calculate Area that will calculate the area of the triangle and returns the area value. (iii) Function displayResult that will display the perimeter and area values on the screen. Your main program will ask the user to provide the length of two sides (x and y) of the right triangle. Use cmath library function to assist you. Given below are the formulas: z = x + y 1 Z area xxx y X 2
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started