Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING C++ CODING Objectives: 1. Be able to use the call-by-value mechanism 2. Be able to use the call-by-reference mechanism Write a program called all

USING C++ CODING

image text in transcribed

image text in transcribed

Objectives: 1. Be able to use the call-by-value mechanism 2. Be able to use the call-by-reference mechanism Write a program called "all area semi.cpp" that computes the area of an arbitrary triangle. Use the following formula area = /s(s-a)(s-b)(s-c) where a, b and c are the lengths of the sides, and s is the semiperimeter. s=(a + b + c) / 2 Include a void function call "Compute" that computes the area and perimeter of a triangle based on the length of the sides. The function should use five parameters three call by value parameters (a, b, c) that provide the lengths of the edges and two call by reference parameters (area, semiperimeter) that stores the computed area and perimeter. Make your function robust. The function "compute should be called from your main program. Your must print the computed area and semiperimeter rounded to the nearest hundredths. In main you should declared the necessary variables, and include a while loop asking the user if he/she would like to continue computing area and semiperimeters Note that not all combinations of a, b, and c produce a triangle. Remember, the sum of any two sides of a triangle must be greater than the third side. You must make sure that the lengths of the sides of the triangle entered by the user are valid; if not valid lengths, you should let the user know by printing a message stating that the lengths are invalid, and then prompt the user if he/she would like to continue computing area and semiperimeters. Your function should produce correct results for legal data and reasonable results for illegal combinations

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

LO2 Identify components of workflow analysis.

Answered: 1 week ago