Question: input: length of side -- int output: perimeter -- message to stdout Write a C++ program that accepts a single numeric value as the length
input: length of side -- int
output: perimeter -- message to stdout
Write a C++ program that accepts a single numeric value as the length of the side of an equilateral triangle or the length of a square.
Compute the perimeter of each one by using the formula:
perimeter = 3 * side for the triangle and
perimeter = 4 * side for the square .
The program dialog should look like this:
Enter the length of a side (in inches): 50.1 The perimeter of as square w/ 1 side of length 50.1 = 200.4 inches The perimeter of an equilateral triangle w/ 1 side of length 50.1 = 150.3 inches
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
