x.Hmeed help to complet this program: Solution x.Xlor=\"red\">please rate - than
ID: 3618018 • Letter: X
Question
x.Hmeed help to complet this program:Explanation / Answer
x.Xlor="red">please rate - thanks //Purpose: This program reads data for a computer science closed lab section. // (1) Add a function StudentAvg which finds and prints the lab average for each // student in the class. Activate this function in the the main program. // (2) Add a function LabAvg() which finds and prints the average score made on // each individual lab. Activate this function in the the main program. // For both functions, follow the format specified. //Input: The first two entries in the input are the number of students // in the class and the number of closed labs the class has finished. // For each student, their closed labs are input from the // following lines of the file. // //Limitations: It is assumed that there will be no more than // MAX_STUDENTS students in the class and there will be // no more than MAX_LABS labs. //include files... #include using namespace std; //global constants... const int MAX_STUDENTS=40; //maximum number of students const int MAX_LABS=14; //maximum number of closed labs //function prototypes... //function to read labs from the data file void ReadScores(int labScores[][MAX_LABS], int& numStudents, int& numLabs); //your function prototypes should go here!!! // StudentAvg() finds and prints the lab average for each student in the class. void StudentAvg(const int labScores [][MAX_LABS], int numStudents, int numLabs); // LabAvg() finds and prints the average score made on each individual lab. void LabAvg(const int labScores [][MAX_LABS], int numStudents, int numLabs); int main() { //local declarations... int numStudents; //how many students are in the class int numLabs; //how many closed labs int labScores[MAX_STUDENTS][MAX_LABS]; //holds lab scores //read in the data for all students in the class ReadScores(labScores, numStudents, numLabs); cout > numStudents >> numLabs; //outer loop controls which student(row) is being read for (student = 0; student labScores[student][lab]; } return; } void StudentAvg(const int labScores [][MAX_LABS], int numStudents, int numLabs) {int student,lab,sum; double average; for (student = 0; studentRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.