using function input data and print data.
how to define a class student with data members student roll no,student name,adress,fees with function input data and print data?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Wim SturkenboomPosted Dec 11, 2014, 12:11 AM
class student
{
int rollno;
string name;
string address;
double fees;
///
/// update student information
///
///
///
///
///
public void update(int iRollno, string strName, string strAddress, double dblFees)
{
rollno = iRollno;
name = strName;
address = strAddress;
fees = dblFees;
}
///
/// get printable data
///
///
public string print()
{
string result = String.Format("{0,-15}{4}\n{1,-15}{5}\n{2,-15}{6}\n{3,-15}{7}",
"Name:",
"RollNo:",
"Address:",
"Fees:",
name, rollno, address, fees);
return result;
}
}