Question: #include #include using std::string; using std::cout; using std::endl; void testAnswer(string testname, int answer, int expected) { if (answer == expected) cout < < PASSED:

#include #include

using std::string; using std::cout; using std::endl;

void testAnswer(string testname, int answer, int expected) { if (answer == expected) cout << "PASSED: " << testname << " expected and returned " << answer << " "; else cout << "FAILED: " << testname << " returned " << answer << " but expected " << expected << " "; }

// Implement printArray here void printArray(int array[],int b) { for(int i = 0; i

// EDIT CODE BELOW ONLY FOR TESTING (YOUR CODE WILL BE GRADED WITH DIFFERENT TESTS)

int main() { cout << "count elements larger than a given number "; { int myarray[] = {92, 45, 23, 45, 10}; cout << "Contents of array : "; printArray(myarray, 5); testAnswer("countArray(myarray, 5, 40)", countArray(myarray, 5, 40), 3); testAnswer("countArray(myarray, 5, 100)", countArray(myarray, 5, 100), 0); testAnswer("countArray(myarray, 5, 90)", countArray(myarray, 5, 90), 1); } { int myarray[] = {92, 45, 23, 45}; cout << "Contents of array : "; printArray(myarray, 4); testAnswer("countArray(myarray, 4, 100)", countArray(myarray, 4, 100), 0); testAnswer("countArray(myarray, 4, 40)", countArray(myarray, 4, 40), 3); } { int myarray[] = {0}; cout << "Contents of array : "; printArray(myarray, 0); testAnswer("countArray(myarray, 0, 10)", countArray(myarray, 0, 10), 0); } // system("pause"); // comment/uncomment if needed

return 0; }

i just neeed someone to solve the count array please asap i have one hour

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!