Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ The functions can be declared as void getData (double& base, double& height); void computing (double base, double height, double& area, double& perimeter); void print
C++
The functions can be declared as
void getData (double& base, double& height);
void computing (double base,
double height,
double& area,
double& perimeter);
void print (double area, double perimeter);
Write a program that uses functions to compute the perimeter and area of a right triangle when given the length of two sides a and b. b The following formulas may be helpful: C2 = a2 + b2 0.5 * a * b area Requirements A structure chart for this problem is given as follows: area Perimeter getData computing print Declare all the variables and parameters as double. Input Two side a and b of a right triangle. Output Area and perimeter of the right triangle. An Example of Test Run The output of your program might look like this: csci>a.out Enter the length of side a: 3.0 Enter the length of side b: 4.0 The perimeter is 12.0. The area is 6.0. Do you want to calculate another set of data? Y Enter the length of side a: 2.0 Enter the length of side b: 7.0 The perimeter is 16.8. The area is 7.0. Do you want to calculate another set of data? N Thank you
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