Weekly project 3 (1) (2) -- multi-subject transcript
/* Copyright (c) 2014, School of Computer Science, Yantai University * All rights reserved. * file name: test. cpp * Author: Chen Danni * completion date: December 02, 2014 * version No.: v1.0 ** Problem description: score of a certain class, make a transcript and use a two-dimensional array score [] [4] To save the scores of high numbers, English, and c ++, and obtain the highest score, lowest score, and average value. * Description: Number of Students and score. * Program output: Output transcript */# include
# Include
Using namespace std; void input (double s [] [4], int n); // input result void output (double s [] [4], int n ); // output result double max (double s [] [4], int n, int I); // calculate the highest score of the I course, I = 3 is the total value of double min (double s [] [4], int n, int I ); // calculate the lowest score of the Class I, double avg (double s [] [4], int n, int I ); // calculate the average score of the I course. int main () {int I, num; string temp; double score [100] [4]; // set up a maximum of 100 persons in a class. The actual string course [4] = {"Advanced Mathematics", "English", "C ++", "total score"} according to the input "}; cout <"Number of students:"; cin> num; // (1) enter the score and obtain the total score input (score, num); // (2) output score output (score, num); // (3) output the maximum score, lowest score, average score, and standard deviation of each course and total score; for (I = 0; I <4; ++ I) {cout <
S [I] [0]> s [I] [1]> s [I] [2]; s [I] [3] = s [I] [0] + s [I] [1] + s [I] [2];} void output (double s [] [4], int n) // output score {cout <"the input Student Score is:" <
S [I] [j]) m = s [I] [j]; return m;} double avg (double s [] [4], int n, int j) {double sum = s [0] [j]; for (int I = 1; I
Learning Experience: In general, the beginning is very complicated, but if you solve small problems one by one, this question will be much better.
Don't be intimidated by problems. Solve them one by one, from top to bottom, and gradually improve.