#include
#include
class student
{
char name[20];
char no[10];
float math;
float english;
float phisics;
float cpp;
public:
void setnameno(char *na,char *n)
{
strcpy(name,na);
strcpy(no,n);
}
void setscore(float m,float e,float p,float c)
{
math=m;
english=e;
phisics=p;
cpp=c;
}
double total(void)
{
return (math+english+phisics+cpp);
}
double average(void)
{
return (total()/4.0);
}
void outputinfo(void)
{
cout<
};
void main()
{
student a,b;
a.setnameno("zhang","010540224");
a.setscore(87,89,98,88);
b.setnameno("xiao","010540226");
b.setscore(87,99,98,89);
cout<<"Name\tNo\t\tMath\tEnglish\tPhisics\tcpp\ttotal\taverage"<
b.outputinfo();
}