Please help me in this code

Remove the error please . My head is burst

#include <iostream>
#include<conio.h>
#include<string.h>

using namespace std;

class Batsman
{
public:

void readData1( string code );
string displayData1( void );
void readData2( string name );
string displayData2( void );
void readData3( int inn );
int displayData3( void );
void readData4( int ntOut );
int displayData4( void );
void readData5( int rns);
int displayData5( void );
void readData6(float avg);
float displayData6(void);

private:
string bCode;
string bName;
int innings;
int notOut;
int runs;
float batAvg;
float calAvg(int runs,int innings,int notOut);




};

// Member functions definitions
string Batsman::displayData1(void)
{
return bCode;
}

void Batsman::readData1( string code )
{
bCode=code;
}
string Batsman :: displayData2(void)
{
return bName;
}

void Batsman::readData2( string name )
{
bName=name;
}
int Batsman::displayData3(void)
{
return innings;
}

void Batsman::readData3( int inn )
{
innings=inn;
}
int Batsman::displayData4(void)
{
return notOut;
}

void Batsman::readData4( int ntOut )
{
ntOut=notOut;
}
int Batsman::displayData5(void)
{
return runs;
}

void Batsman::readData5( int rns )
{
runs=rns;
}
float Batsman::displayData6(void)
{
return calAvg();
}

void Batsman::readData6( int rns,int inn,int ntOut )
{

runs=rns;
innings=inn;
notOut=ntOut;
float calAvg(int runs, int innings , int notOut )
{
batAvg=runs/(innings-notOut);
return batAvg;
}

}

// Main function for the program
main( )
{
Batsman az;
string bCd;
string nme;
int inns;
int runss;
int NtO;
cout<<"\n Enter Batsman Bcode \n";
cin>>bCd;
cout<<"\n Enter Batsman Name \n";
cin>>nme;
cout<<"\n Enter his number of innings \n";
cin>>inns;
cout<<"\n Enter number of not-outs \n througout his innings \n";
cin>>NtO;
cout<<"\n Enter number of runs he makes \n in his inning or innings \n";
cin>>runss;
az.readData1(bCd);
az.readData2(nme);
az.readData3(inns);
az.readData4(NtO);
az.readData5(runss);
az.readData6(runss,inns,NtO);
cout<<"\n Batsman Bcode \n ="<<az.displayData1();
cout<<"\n Batsman Name \n ="<<az.displayData2();
cout<<"\n Batsman Innings \n ="<<az.displayData3();
cout<<"\n Batsman Not-outs \n ="<<az.displayData4();

cout<<"\n Batsman Runs \n ="<<az.displayData5();
cout<<"\n Batsman Average \n="<<az.displayData6();
getch();
}
1) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

2) What error? We can't read your mind.
Line 31: You declare that calAvg takes 3 arguments.

Line 86: You call calAvg with no arguments.

Line 21: You declare readData6 takes one argument.

Line 89: Your implementation of readData6 takes 3 arguments.

Line 104: main() must be type int.

Line 3: The correct header is <string>, not <string.h>. <string.h is the C header, not C++.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
//Now the program is running but can,t get my average .
//Please correct this code .
#include <iostream>
#include<stdlib.h>
#include<conio.h>
#include<string>

using namespace std;

class Batsman
{
public:

void readData1( string code );
string displayData1( void );
void readData2( string name );
string displayData2( void );
void readData3( int inn );
int displayData3( void );
void readData4( int ntOut );
int displayData4( void );
void readData5( int rns);
int displayData5( void );
void readData6(int rs1,int is1,int nt1);
float displayData6(void);


private:
string bCode;
string bName;
int innings;
int notOut;
int runs;
float batAvg;
float calcAvg(int rs,int is,int nt)
{

float avg= rs/(is-nt);
return avg;

}





};

// Member functions definitions
string Batsman::displayData1(void)
{
return bCode;
}

void Batsman::readData1( string code )
{
bCode=code;
}
string Batsman :: displayData2(void)
{
return bName;
}

void Batsman::readData2( string name )
{
bName=name;
}
int Batsman::displayData3(void)
{
return innings;
}

void Batsman::readData3( int inn )
{
innings=inn;
}
int Batsman::displayData4(void)
{
return notOut;
}

void Batsman::readData4( int ntOut )
{
notOut=ntOut;
}
int Batsman::displayData5(void)
{
return runs;
}

void Batsman::readData5( int rns )
{
runs=rns;
}
void Batsman :: readData6(int rs1,int is1,int nt1)
{
batAvg=calcAvg(rs1,is1,nt1);
}
float Batsman :: displayData6(void)
{
return batAvg;
}


// Main function for the program
main( )
{
Batsman az;
string bCd;
string nme;
int inns;
int runss;
int NtO;
cout<<"\n Enter Batsman Bcode \n";
cin>>bCd;
cout<<"\n Enter Batsman Name \n";
cin>>nme;
cout<<"\n Enter his number of innings \n";
cin>>inns;
cout<<"\n Enter number of not-outs \n througout his innings \n";
cin>>NtO;
cout<<"\n Enter number of runs he makes \n in his inning or innings \n";
cin>>runss;
az.readData1(bCd);
az.readData2(nme);
az.readData3(inns);
az.readData4(NtO);
az.readData5(runss);
az.readData6(runss,inns,NtO);
//az.readData6(runss,inns,NtO);
cout<<"\n Batsman Bcode \n ="<<az.displayData1();
cout<<"\n Batsman Name \n ="<<az.displayData2();
cout<<"\n Batsman Innings \n ="<<az.displayData3();
cout<<"\n Batsman Not-outs \n ="<<az.displayData4();
cout<<"\n Batsman Runs \n ="<<az.displayData5();
cout<<"\n Batsman Average \n="<<az.displayData6();

getch();
}
i am getting average by using friend function .
But i want to do this by using setter and getter rule.
You have been asked multiple times to use code tags. PLEASE DO SO.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
If you're not going to make the slightest bit of effort to make your posts readable, why should we spend the slightest bit of effort helping you?
I will not respond further until you apply code tags.
Topic archived. No new replies allowed.