Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed undefined reference to `calculatewd(float, float, float)' collect2: error: ld returned 1 exit status

0 votes
asked Nov 30, 2019 by Mior Aiman (190 points) 1 flag
closed Nov 30, 2019 by Mior Aiman
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
float calculatewd(float,float,float);
float calculatedw(float,float,float);

 int main(){
     float x,y,z,a,b,c;
     char input;
     
     
    do{
       cout<<"input W for conversion of WYE to Delta or D for conversion of Delta to WYE"<<endl;
       cin>>input;
   }
   while((input!='W') && (input!='D'));
   
if (input=='w'|| input=='W'){
    
    cout<<"input value for Resistor 1, Resistor 2, Resistor 3"<<endl;
    
   std::cin >> x;
   std::cin >> y;
   std::cin >> z;
    
    calculatewd(x,y,z);
    return (x,y,z);
}else if(input=='d'|| input=='D'){
    
    cout<<"input value for Resistor A, Resistor B, Resistor C"<<endl;
    std::cin >> a;
    std::cin >> b;
    std::cin >> c;
        calculatedw(a,b,c);
        return (a,b,c);
}
return 1;
}
float calculateawd(float r1, float r2, float r3){    
    float ra,rb,rc;
    ra=((r1*r2)+(r2*r3)+(r3*r1))/(r1);
    rb=((r1*r2)+(r2*r3)+(r3*r1))/(r2);
    rc=((r1*r2)+(r2*r3)+(r3*r1))/(r3);
    
    cout<<"value Resistor A is "<<ra<<endl;
    cout<<"value Resistor B is "<<rb<<endl;
    cout<<"value Resistor C is "<<rc<<endl;
    return (ra,rb,rc);
}
float calculatedw(float ra, float rb, float rc){
    float r1,r2,r3;
    
    
    r1=(rb*rc)/(ra+rb+rc);
    r2=(ra*rc)/(ra+rb+rc);
    r3=(ra*rb)/(ra+rb+rc);
    
    cout<<"value Resistor 1 is "<<r1<<endl;
    cout<<"value Resistor 2 is "<<r2<<endl;
    cout<<"value Resistor 3 is "<<r3<<endl;
    
    return (r1,r2,r3);
}
closed with the note: i've found the answer
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...