public :
void getdata();
void assign();
};
void student :: getdata()
{
int i;
cout<<"Student name : ";
cin>>name;
cout<<"Enter the roll no : ";
cin>>rollno;
cout<<"Enter the marks of 5 subjects :"<<endl;
cout<<"Maximum marks = 100"<<endl;
for(i=0; i<5; i++)
{
cin>>marks[i];
}
}
void student :: assign()
{
float tot=0, avg;
for(int i=0; i<5; i++)
tot += marks[i];
avg = tot/5;
if (avg >= 96.00) strcpy (stream, "Computers");
else if (avg >= 91.00) strcpy (stream, "Electronics");
else if (avg >= 86.00) strcpy (stream, "Mechnical");
else if (avg >= 81.00) strcpy (stream, "Electrical");
else if (avg >= 76.00) strcpy (stream, "Chemical");
else if (avg >= 71.00) strcpy (stream, "Civil");
else strcpy (stream, "None");
cout<<"The stream is: "<<stream;
}
int main ()
{
class student obj;
clrscr();
obj.getdata();
obj.assign ();
getch();
return 0;
}