i am teaching myself c++ and i thought that when i pass an argument to a function it supposed to use it. but his one says "salary was not declared in this scope" what????
#include <iostream>
usingnamespace std;
void qualify(){
cout << "congratulations you qualify!! our card comes with a 12% annual interes fee." << endl;
}
void noQualify(); // function prototype
int main()
{
double salary;
int years;
cout << "This program will determine if you qualify\n";
cout << "for out cridit card.\n";
cout << "what is your annual salary? ";
cin >> salary;
cout << "How many years have you worked at your ";
cout << "current job? ";
cin >> years;
if (salary >= 17000.0 && years >= 2)
qualify();
else
noQualify(salary);
return 0;
}
void noQualify(){
if (salary < 17000.0)
cout << "your salary isnt enough to meet our minimum requierments." << endl;
else
cout << "you dont have the experiance in your work area to meet our minimum requierments." << endl;
}