(Solved) : Include Include Using Std String Using Std Cout Using Std Endl Void Testanswer String Test Q43995541 . . .
#include <iostream>
#include <string>
using std::string;
using std::cout;
using std::endl;
void testAnswer(string testname, int answer, int expected){
if (answer == expected)
cout << “PASSED: ” << testname << ” expected andreturned ” << answer << “n”;
else
cout << “FAILED: ” << testname << ” returned “<< answer << ” but expected ” << expected<< “n”;
}
// Implement printArray here
void printArray(int array[],int b)
{
for(int i = 0; i<b;i++)
{
std::cout<< array[i] << ” ” <<std::endl;
}
}
int countArray(myarray[],int boo,int bla){
//idk how to do countarray
// Implement countArray here
// EDIT CODE BELOW ONLY FOR TESTING (YOUR CODE WILL BE GRADED WITHDIFFERENT TESTS)
int main() {
cout << “count elements larger than a given numbern”;
{
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 haveone hour
Expert Answer
Answer to #include #include using std::string; using std::cout; using std::endl; void testAnswer(string testname, int answer, int …
OR