/*
*copyright (c) 2014, College of Computer Science, Yantai University
*all rights reserved.
* File name: 14 weeks (multi-course score table)
* Wangzhong
* Completion Date: 2014.12.01
* Version Number: v1.0
*
* Problem Description: Enter the student's scores, automatically find out the total score, the highest, the lowest, the average score.
* Input Description: Results of each section
* Program output: Total score, highest, lowest, average.
#include <iostream> #include <string>using namespace std;void input (double s[][4],int n), void output (double S[][4],int N);d ouble max (double s[][4],int n,int i);d ouble min (double s[][4],int n,int i);d ouble avg (double s[][4],int n,i NT i); int main () {int i,num; string temp; Double score[100][4]; String course[4]= {"Advanced mathematics", "English", "C + +", "Total Score"}; cout<< "Enter the number of students:"; cin>>num; for (i=0; i<4; i++) {cout<<course[i]<< "\ t"; } cout<<endl; Input (Score,num); Output (Score,num); for (i=0; i<3; ++i) {cout<<course[i]<< "the highest score is" <<max (score,num,i) << ","; cout<< "The lowest score is" <<min (score,num,i) << ","; cout<< "average score for" <<avg (score,num,i) << ","; cout<<endl; }}void input (double score[][4],int num) {int sum=0,i,j; For (i=0, i<num; i++) {for (j=0; j<3; J + +) {cin>>score[i][j]; Sum=sum+scorE[I][J]; } score[i][j]=sum; sum=0; cout<<score[i][j]; cout<<endl; }}void output (double score[][4],int num) {int i,j; For (i=0, i<num; i++) {for (j=0; j<4; j + +) cout<<score[i][j]<< "\ T"; cout<<endl; }}double Max (double score[][4],int n,int i) {int j=0,d; D=score[j][i]; for (; j<n; ++j) {if (D<score[j][i]) d=score[j][i]; } return D;} Double min (double score[][4],int n,int i) {int j=0,x; X=score[j][i]; for (; j<n; ++j) {if (X>score[j][i]) x=score[j][i]; } return x;} Double avg (double score[][4],int n,int i) {int j=0,sum; Double average; for (; j<n; ++j) sum=sum+score[j][i]; average=sum/n; return average;}
14 Weeks (multi-course score table)