Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN C++ General requirements: - No global variables - No multiple return statements in one function - Show how you have tested these functions

CODE IN C++

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.

image text in transcribed

image text in transcribed

Examples of testing data: Question \#2: Write a function named "analyzeGradeList" that is given a two-dimensional array containing the passing grades from students which contains 'P' for passing and 'N' for not-passing Each student will have exactly 2 classes (chars). The function will return two set of values: - the number of students who have 1 pass and 1 no-pass. - the total counts of 'P' grades only for each separate class. Note: The function can handle any number of students (array size) but each student must have exact 2 classes only. Please consider passing the array of 2 integers to pass back the counts for each grade. Examples of testing data: char gradeList1 [][2]={{P,N}}} char gradeList2 [][2]={P,P}}; char gradeList 3[[2]={{N,}}; Here are the corresponding returned values in the same order: One Pass Count: 1 Passing Count for class \#1: 1 Passing Count for class \#2: 0 One Pass Count: 0 Passing Count for class \#1: 1 Passing Count for class \#2: 1 One Pass Count: 0 Passing Count for class \#1: 0 Passing Count for class \#2: 0 One Pass Count: 1 Passing Count for class \#1: 0 Passing Count for class \#2: 1 One Pass Count: 3 Passing Count for class \#1: 4 Passing Count for class \#2: 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems X Special Issue On Database And Expert Systems Applications Lncs 8220

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2013th Edition

3642412203, 978-3642412202

More Books

Students also viewed these Databases questions