需求分析 功能描述 总体设计
ev(1);
cout<<"政治\n";
cout<<"最高分:"<<hi(2)<<" "<<"最低分:"<<lo(2)<<" "<<"平均分:"; av(2); ev(2);
cout<<"程序设计基础\n";
cout<<"最高分:"<<hi(3)<<" "<<"最低分:"<<lo(3)<<" "<<"平均分:"; av(3); ev(3);
cout<<"物理\n";
cout<<"最高分:"<<hi(4)<<" "<<"最低分:"<<lo(4)<<" "<<"平均分:"; av(4); ev(4); }
double list::hi(int i) {
high[i]=0.00;
student *temp=first; while(temp!=0)
{if(temp->outgrade(i)>high[i]) high[i]=temp->outgrade(i); temp=temp->next; }
return high[i]; }
double list::lo(int i) {
low[i]=100;
student *temp=first;while(temp!=0) {if(temp->outgrade(i)<low[i]) low[i]=temp->outgrade(i); temp=temp->next; }
return low[i]; }
void list::av(int i) {
double aver=0;
student *temp=first; while(temp!=NULL) {