I'm not so sure what to do here. I just need a little bit of direction as to where I should start.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include<iostream.h>
#include<lvp\string.h>
#include"StringUtility.h"
#include<lvp\CIRCLE.h>
#include<math.h>
int main()
{
CircleClass tire(17);
cout<<getVolume();//don't know what to put here
return(0);
}
//----------------------------------------------------------------------------
double getVolume(const CircleClass &obj)
/*Determines the volume of the sphere based upon the Circle object parameter*/
{
int Radius;
obj.SetRadius(Radius);
return (double(4/3)*double(3.14*(pow(Radius,3))));
}
Line 9 calls function getVolume that does not have any parameters.
Lines 13-17 define function getVolume that takes one parameter. The function uses the parameter like it were a number representing radius(?) even though the parameter has type CircleClass.
First, in order to call "getVolume" on line 9, the function has to be already declared before the main() starts. Does one of the included headers declare getVolume? I bet not.
If you want to call a function that takes a reference parameter, you have to call it with a parameter. For example:
1 2 3 4 5 6 7
int foo( double & );
int main() {
double bar = 7.42;
int gaz = foo( bar );
return 0;
}