Write a C++ function definition named containsNumber. The function should take three parameters: a one-dimensional integer array, the number of entries in the array, and an integer value. The function should search the array for the integer value and return a boolean value of true if the value is found and false otherwise. Below is a example call to the function: valueFound = containsNumber(table, nbrOfEntries, value); You may assume that all parameters passed to the function are valid, that the nbrOfEntries amount is always greater than or equal to one, and that a specific integer value occurs at most once in the table. Remember to only write the function definition for the containsNumber function. Do not write a complete C++ program.
Write a C++ function definition named containsNumber. The function should take three parameters: a one-dimensional integer array, the number of entries in the array, and an integer value. The function should search the array for the integer value and return a boolean value of true if the value is found and false otherwise. Below is a example call to the function:
valueFound = containsNumber(table, nbrOfEntries, value);
You may assume that all parameters passed to the function are valid, that the nbrOfEntries amount is always greater than or equal to one, and that a specific integer value occurs at most once in the table.
Remember to only write the function definition for the containsNumber function. Do not write a complete C++ program.
Step by step
Solved in 3 steps