Hey,
I am just getting started building programs with multiple modulus/functions. I am having trouble getting the syntax correct. I keeping on getting this error when trying to fun this program. This is a program to calculate the area of a triangle using Heron's Formula.
1>c:\users\brendan\desktop\lab5no2\lab5no2\lab5no2.cpp(26): error C2447: '{' : missing function header (old-style formal list?)
Any pointers are greatly appreciated.
Thanks,
Bob Sancamento
Sorry i did this wrong lets try again
I am just getting started building programs with multiple modulus/functions. I am having trouble getting the syntax correct. I keeping on getting this error when trying to fun this program. This is a program to calculate the area of a triangle using Heron's Formula.
1>c:\users\brendan\desktop\lab5no2\lab5no2\lab5no2.cpp(26): error C2447: '{' : missing function header (old-style formal list?)
Any pointers are greatly appreciated.
Thanks,
Bob Sancamento
#include <iostream> #include <cmath> #include <iomanip> using namespace std; double areaOfaTriangle(double, double, double); int main() { double varA, varB, varC; cout << "What is the Length of SIDE A? :"; cin >> varA; cout << "\nWhat is the Length of SIDE B? :"; cin >> varB; cout << "\nWhat is the Length of SIDE C? :"; cin >> varC; cout << "The are of the triang is " << areaOfaTriangle( varA, varB, varC) << endl; return 0; } double areaOfaTriangle(double varA1, double varB1, double varC1); { double varS, varX, aRea; varS = (varA1 + varB1 + varC1 +)/2; varX = varS * ((varS - varA1)*(varS-varB1)*(varS-varC1)); if (varX <= 0) { aRea = sqrt[varX]; } else { aRea=-1; } return aRea; }
Sorry i did this wrong lets try again