I'm writing a program that asks the user for 3 sides. Makes sure it could be a triangle, and then uses equations to figure out the area and perimeter of the triangle. The program should only use 3 functions.
For whatever reason, my code won't run. I know I'm close but there is something that is least bit off.
#include<iostream>
#include<cmath>
using namespace std;
bool valid(int side1, int side2, int side3);
void semi_perimeter(int side1, int side2, int side3, double& semi);
void get_area(int side1, int side2, int side3, double& area, double& perimeter);
int main()
{
int one_side, two_side, three_side;
double area, perimeter, semi;
bool isvalid;
char ans;
do{
do{
do{
cout << "\nEnter the length of the first side (whole #): ";
cin >> one_side;
cout << "\nA triangle with sides of " << one_side << ", " << two_side
<< " and " << three_side
<< " has a perimeter of " << get_area(one_side, two_side, three_side, area, perimeter)
<< " and an area of " << get_area(one_side, two_side, three_side, area, perimeter);
cout << "\nWould you like to run the program again? (y or n): ";
cin >> ans;