Calculate total fee of n number of student after including total fine and display on screen.

#include
#include
class student
{
private:
char name[15];
int rn;
float fee,fine,tf;
}
public:
void getdata();
void calc();
void printdata();
};
void student::printdata()
{
cout<< name<<"tt"<<rn<<"t"<<fee<<"t"<<fine<<"t"<<tf;
}
void student::getdata()
{
cout<>name;
cout<>rn;
cout<>fee;
cout<>fine;
}
void student::calc();
{
tf=(fee+fine);
}
main()
{
student a[60];
int i,n;
clrscr();
cout<>n;
cout<<"n Details of student:";
for(i=1;i<=n;i++)
{
cout<<"n Student No:"<<i;
a[i].getdata();
}
for(i=i;i<=n;i++)
{
a[i].fcalc();
}
cout<<"n Sn No.tNamettRoll NumbertFeetFinetTotal fee:";
for(i=1;i<=n;i++)
{
cout<<"n"<<i<<"";
a[i].printdata();
}
getch();
}

Leave a reply