Question
General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these functions - cin and
General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these functions - cin and cout are not allowed in these functions. They can only be in main() or testing functions. It should return the values to the caller through the use of return type and pass-by-reference parameters. - Please do not use struct, tuple or pair class. Please use only pass-by-reference parameters and return type to return values to the caller. - Please do not use string class - Please do not change or sort the array Note: this is an exercise to use functions with 2-dimensional arrays
Question #1: Write a function named "getScoreStats" that is given a two-dimensional array containing the scores of students in a class. Each student will have exactly 3 scores (integers). The function will return the following three values: - the number of students that have at least 1 perfect score of 100. - count of how many students that have all three perfect scores of 100 - how many students have score than is more than 100
Note: The function can handle any number of students (array size) but each must have exact 3 scores.
Examples of testing data: int stuScoreList1[][3] = { {100, 100, 100} } ; int stuScoreList2[][3] = { {0, 0, 0 } } ; int stuScoreList3[][3] = { {100, 0, 50 } } ; int stuScoreList4[][3] = { {50, 0, 150 } } ; int stuScoreList5[][3] = { {100, 100, 100 }, {150, 0, 0 } } ; int stuScoreList6[][3] = { {30, 50, 70 }, {100, 100, 100}, {101, 20, 50 }, {150, 100, 40 }, {100, 100, 100}, {100, 50, 40 } } ; int stuScoreList7[][3] = { {30, 50, 70 }, {10, 20, 50 }, {100, 100, 40 } } ;
Here are the corresponding returned values in the same order: At least one perfect score: 1 All perfect scores: 1 Invalid scores: 0 At least one perfect score: 0 All perfect scores: 0 Invalid scores: 0 At least one perfect score: 1 All perfect scores: 0 Invalid scores: 0 At least one perfect score: 0 All perfect scores: 0 Invalid scores: 1 At least one perfect score: 1 All perfect scores: 1 Invalid scores: 1 At least one perfect score: 4 All perfect scores: 2 Invalid scores: 2 At least one perfect score: 1 All perfect scores: 0 Invalid scores: 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started