I am doing a project for school and making this program that calls on multiple functions but I seem to keep getting an error that
'TotalValue' cannot be used as a function on line 44
and I can't seem to fix it. I tried setting mulitple different variables to see if it would change anything but nothing seems to work. Help appreciated!
#include<iomanip>
#include<iostream>
#include<cmath>
using namespace std;
int SurfaceArea (float L, float H, float W, float &SA,float P, float I,float simpI, float T, float &TV, float TotalValue);
int main ()
{
float L, H, W, SA, P, I,T,TV,TotalValue,simpI;
cout << " Enter the Length: ";
cin >> L;
cout << "Enter the Height: ";
cin >> H;
cout << "Enter in the Width: ";
cin >> W;
SurfaceArea(L, H, W,SA,P,I,T,TV,TotalValue,simpI);
cout << "The surface area of your prism is: " << SA;
return 0;
cout << "Enter in your principle: ";
cin >> P;
cout << "Enter in your interest rate: ";
cin >> I;
cout << "Enter in the time: ";
cin >> T;
TotalValue(P,I,T,TV);
cout << "Total value: " <<TV;
}
int SurfaceArea(float L, float W, float H, float &SA)
{
SA = 2.0*(L * W) + 2.0*(L * H) + 2.0*(W * H);
return 0;
}
int TotalValue(float P, float I, float T,float &TV,float simpI)
{
simpI = I/100;
TV = P*(1+simpI*T);
return 0;
}