user defined functions and mian

Main will not invoke the user defined function..I have been over it a hundred times and have been through the tutorials. So please no tutorials.
Can some one please tell me why the program is not calling for this function

#include<iostream>
#include<iomanip>

using namespace std;
/* user -defined function
*inputs the current age(good age and compares to to 30(mature) if the age id
*over 30 the program will not prompt for gender.
*
* input age, 30
*
*output age
*/
int noGender (int,int)
{

int mature;
int goodAge;

if ( goodAge > mature ){
goodAge =( mature != 'M' ) && ( mature !='F');
cout<<"too Old"<<endl;}
else if
(goodAge == mature){
return goodAge;
}
}
int main()

{

char gender;
int time;
int age;
int maleRate;
int femaleRate;
int vehicleValue;
int fourteenTosixteen;
int seventeenTotwentyone;
int twentytwoTotwentysix;
int twentysevenTothirty;
int thirtyoneTosixtyfour;
int sixtyfiveTosevenfive;
int overSeventyfive;
int tooOld = 30;

const double CUSTOMERRATE01 = .095;
const double CUSTOMERRATE02 = .008;
const double CUSTOMERRATE03 = .082;
const double COSTOMERRATE04 = .069;
const double CUSTOMERRATE05 = .074;
const double CUSTOMERRATE06 = .058;
const double CUSTOMERRATE07 = .062;
const double CUSTOMERRATE08 = .052;
const double CUSTOMERRATE09 = .051;
const double CUSTOMERRATE10 = .062;
const double CUSTOMERRATE11 = .075;

// Begin Program
cout << endl;

cout <<" "<< "Insurance Premium Calculation Program\n\n\n";

cout <<" "<< "Enter driver's age: ";
cin>>age;
time = noGender (age,30);
// Check exit critera

if (age < 14) {
cout<<" "<< "too young to drive\n\n";

system ("PAUSE");
return 14;
}
else
{
age<30;
}cout<<endl;

cout<< endl;

cout <<" "<< "Enter driver's gender"<<" "<<"(M/F): ";
cin >> gender;


cout << endl << endl;

cout <<" "<< "Enter vehicle value: ";
cin >> vehicleValue;

cout << endl<<endl<<endl<<endl<<endl;

cout <<" "<< "Auto Insurance Bill "<<endl<<endl<<endl;

cout <<fixed<<setw(20) << right;
cout << "Vehicle Value:\t"<< vehicleValue << endl;

cout <<fixed<<setw(16) << right;
cout << "Rate Used:\t";
cout << endl;

cout <<fixed<<setw(21) << right;
cout << "Annual Premium:\t"<<endl;
cout <<endl;




cout<<endl<<endl;
system ("PAUSE");
return 0;
}
Your function is missing named arguments. And your function's local variables, mature and goodAge, are uninitialized. If you are using a decent compiler and have warnings enabled, the compiler will tell you that.
your function has not arguments, you simply have (int ,int) so there is no input variable going in. This is causing your mature and goodage variable to not be initialized which result in your program doint nothing. Chane the aruments in your functiion to (int mature, int goodage).
Topic archived. No new replies allowed.