I want to create a program that does the following:
Write a process that would create a function that accepts an array of integer values, a whole number n, and the number of elements in the array. The function should then determine how many values are greater than the whole number n, and return the number of values greater than n to the function call.
I am just beginning to learn C++ on my free time and I want to write the pseudocode first before I get started. Here is what I have written already. Is this anywhere near correct and is there anything I should include/take out?
-input a function that accepts an array of integer values, array of integer values, whole number n, and number of elements in array.
-output how many values are a greater than whole number n and the number of values that are greater than n to the function call.
-create function prototype int values(int [])that accepts array of values
-declare constant integer N (whole number).
-create array for integer values int num[]
-call function values(num[])
-create function header int values(greater[])
-write statement that asks user to display numbers that are greater than N
-use if branch.. if (int num[]>N) return num[]
-else...these values are less than n
accepts an array of integer values, a whole number n, and the number of elements in the array
int values(int [])
These are not equivalent. You need to compare each element of your array to n. Which means you need n. Also, you need to loop over the array to compare the elements. Therefore, in order to know when to stop, you need to size of the array.