I know I'm not the best with functions in C++ and that's probally why I'm having problems, but anyways I keep getting these errors:
[linker error] undefined reference to 'Area(float,float)'
[linker error] undefined reference to 'Circumference(float,float)'
[linker error] undefined reference to 'Diameter(float,float)'
I also get a message that says: Id returned 1 exit status.
I have not the slightest idea what that means.
Here's the code.
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
void Area(float radius, float answer);
void Circumference(float radius, float answer);
void Diameter(float radius, float answer);
int main()
{
void circle_vals(char type, float radius, float answer);
string prompt;
char type;
float radius;
float answer;
prompt= "Please enter the problem type or exit command." ;
cout <<"Please enter the problem type you want then the radius." ;
cout << "Enter A for area, D for diameter, C for circumference, or E 0 to exit.";
cout << "For example you would have A 2.2 to find an area with a 2.2 radius" <<endl;
cin>> type;
cin >> radius;
while (type != 'E')
{
if (type != 'A' || type != 'C' || type != 'D')
{
cout << "That's not a valid problem type" <<endl;
}
if (type =='A')
{
Area(radius, answer);
cout << answer <<endl;
}
if (type =='C')
{
Circumference(radius, answer);
cout << answer <<endl;
}
if (type =='D')
{
Diameter(radius, answer);
cout << answer <<endl;
}
cout << prompt <<endl;
cin >> type;
cin >> radius ;
}
if (type == 'E' )
{
cout << "Thank you.";
}
void Area(float radius, float answer);
answer=0;
{
answer = (radius * radius* 3.14) ;
}
void Circumference(float radius, float answer);
answer=0;
{
answer = (2.0 * radius* 3.14) ;
}
void Diameter(float radius, float answer);
answer=0;
{
answer = (2 * radius) ;
}
system("PAUSE");
return EXIT_SUCCESS;
}