I am having trouble with understanding this error that I am receiving.The object of this assignment is to create a program that prints out 13 school teams, their records, and then to print out the teams who are over .500 in wins. The error occurs inside of my main function when trying to deal with the winning_teams function.
exit status 1
/tmp/ccSw87Of.o: In function `main':
main.cpp:(.text+0x8ea): undefined reference to `winning_teams(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double, double, double)'
collect2: error: ld returned 1 exit status
Here is my code! please help if you can
#include <iostream>
#include<string>
using namespace std;
struct Team
{
string name;
int wins;
int losses;
};
double win_percentage (string , double , double );
void wins_losses (string , double , double , double );
void winning_teams (string , double , double , double );
int main(){
int const NUM = 13;
Team school[NUM]= {
{"Bethune-Cookman", 11, 3}, {"Coppin State", 5, 9}, {"Delaware State", 1, 13},{"Florida A&M", 6, 8},{"Hampton", 11, 4},{"Howard", 6, 8},{"Maryland Eastern Shore", 2, 12},{"Morgan State", 6, 8},{"North Carolina A&T", 10, 4}, {"North Carolina Central", 8, 6},{"Norfolk State", 10, 4},{"Savannah State", 10, 4},{"South Carolina State", 6, 8}};
cout<< "MEAC MENS BASKETBALL TEAMS CONFERENCE STANDINGS"<< endl;
for (int i = 0; i<NUM; i++){
cout<< school[i].name<<" "<<school[i].wins<<"-"<<school[i].losses<< endl;
cout<<"TEAMS WINNING PERCENTAGE"<<endl;
win_percentage(school[i].name,school[i].wins,school[i].losses);
cout<<"TEAMS WITH WINNING RECORDS"<<endl;
wins_losses(school[i].name,school[i].wins,school[i].losses, win_percentage(school[i].name,school[i].wins,school[i].losses));
winning_teams(school[i].name,school[i].wins,school[i].losses,win_percentage(school[i].name,school[i].wins,school[i].losses));
}
return 0;
}
double win_percentage(string a, double b, double c){
double x;
x = (b/(b+c));
return x;
cout<< a<<" "<<x<<endl;
}
void wins_losses( string e, double f, double g, double h){
cout<< e<< "Record is"<<f<<"-"<<g<< h<<endl;
}
void winning_teams(string w, int f, int y, double z){
if ( z >.500){
cout<< w<<" "<<f<< "-"<<y<< " "<< z<< endl;
}
}