c++
Program: 20 points - triangle.cpp
Write, test, and debug a program that prompts the user for 3 sides of two triangles. Your program will be written using a Triangle class and will have 2 Triangle objects (variables/instances of the class).
You will need to write a method (member function) that saves those sides to private object variables, write another method(s) to return the side(s), write another method to return the perimeter, write another method to return the area. This means you will have a minimum of 4 methods in your program, you might have more depending on how you write the methods that save/return the sides.
Perimeter: a + b + c // triangle sides are a, b, c
Area:
#include <cmath> // you will need to include this for the square root function
sqrt(((a+b+c)/2)*(((a+b+c)/2)-a)*(((a+b+c)/2)-b)*(((a+b+c)/2)-c)); // Heron’s Formula
Example program run:
This program will take the 3 sides of two triangles and calculate the perimeter and area
Please enter 3 sides of triangle 1: 16 14 10.5
Please enter 3 sides of triangle 2: 6 7.5 9
The triangle 1
with sides of 16, 14, 10.5
has a perimeter of 40.5
and has an area of 72.4185
The triangle 2
with sides of 6, 7.5, 9
has a perimeter of 22.5
and has an area of 22.3235
11 years ago
5
Purchase the answer to view it

- c.docx
Purchase the answer to view it

- c.zip
- Suppose that, prior to the passage of the Truth in Lending Simplification Act and Regulation Z.
- My Math Homework
- Two Page Paper for Communication Class
- Writing Cause and Effect
- A+ Answers
- qa-8
- ECE 430 Week 5 discussion 1
- perspective of the Dalai Lama from the vantage point of John Hick’s pluralistic hypothesis
- BIO 101 Week 1 What Is Life? Worksheet
- Incoterm HW